By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

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

100+
P: 200
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.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <form id="form1">
  3. <table><tr>
  4.  
  5. <input type="text" text="Keyword" id="keyword" value="">
  6. <input type="button" text="filter" id="filter" onclick="
  7.    <IFRAME id="frame1" src="http://srv08-za199/BI&rs:Command=Render&Key="+filter.value+"></IFRAME>"
  8.  
  9. </tr>
  10.  
Please Assist!
Nov 16 '08 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 397
Do you have an (X)HTML/CSS question?
Nov 16 '08 #2

100+
P: 200
Hi, I thought that this was an HTML question, should i repost to javascript?
Nov 17 '08 #3

100+
P: 200
Working!

Expand|Select|Wrap|Line Numbers
  1. <tr>
  2.   <input type="text" text="Keyword" id="keyword" value="">
  3.   <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;">
  4. </tr>
  5. <tr>
  6.    <IFRAME id="frame1" src="blank.htm">iframe_placeholder_value</IFRAME>
  7.  
  8. </tr>
  9.  
Nov 17 '08 #4

acoder
Expert Mod 15k+
P: 16,027
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.
Nov 17 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.