2 IFrames -Iframe1 btn onclick load iframe2 src & pass iframe1 txtbox val as param

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ismailc
    New Member
    • Sep 2006
    • 200

    2 IFrames -Iframe1 btn onclick load iframe2 src & pass iframe1 txtbox val as param

    Hi, I need help please.

    I need to create a textbox with a report url in an iframe below.
    Onclick of button create IFrame and pass textbox value into parameter of iframe src.

    I'm not to sure how to do this, i think some javascript is needed as I want the button to check the textbox is not blank value first and then create iframe and pass textbox value as parameter.

    Does anyone have another method where there are 2 iframes:
    Having the textbox & button in first frame - then Onclick check textbox not blank and load second iframe - load and pass textbox value as parameter.

    Code:
                                   
    <form id="form1">
    <table><tr>
    
    <input type="text" text="Keyword" id="keyword" value="">
    <input type="button" text="filter" id="filter" onclick="
       <IFRAME id="frame1" src="http://srv08-za199/BI&rs:Command=Render&Key="+filter.value+"></IFRAME>"
    
    </tr>
    Please Assist!
    Last edited by eWish; Nov 16 '08, 08:19 PM. Reason: Fixed code tag
  • David Laakso
    Recognized Expert Contributor
    • Aug 2008
    • 397

    #2
    Do you have an (X)HTML/CSS question?

    Comment

    • ismailc
      New Member
      • Sep 2006
      • 200

      #3
      Hi, I thought that this was an HTML question, should i repost to javascript?

      Comment

      • ismailc
        New Member
        • Sep 2006
        • 200

        #4
        Working!

        Code:
        <tr>
          <input type="text" text="Keyword" id="keyword" value="">
          <input type="button" text="filter" id="filter" onClick="(document.getElementById('keyword').value=='') ? alert('Enter a Keyword!'); document.getElementById('frame1').src='http://srv08-za199/BI&rs:Command=Render&Key='+document.getElementById('keyword').value;">
        </tr>
        <tr>
           <IFRAME id="frame1" src="blank.htm">iframe_placeholder_value</IFRAME>
        
        </tr>
        Last edited by acoder; Nov 17 '08, 10:34 PM. Reason: Fixed code tags

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Yes, it was a JavaScript question - moved to JavaScript.

          Thanks for posting your solution, but I noticed one thing: you've probably got a missing colon for the short-hand if-else syntax.

          PS. can you please ensure you use code tags properly (without a colon in the opening and closing tag). Thanks.

          Comment

          Working...