468,106 Members | 1,493 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,106 developers. It's quick & easy.

submit target iframe opening new window

I have a problem which is a slight twist on discussions I have seen previously here and elsewhere.

I have a form with an input select combo box whose target is an internal static iframe. The form can possibly be submitted several times as users change the selection in the combo box.

On first selection (and form submit) the resulting content is properly directed into the iframe.

However, on subsequent form submits, a new window is opened to display the content.

This happens in Firefox, Safari, and IE.

Any ideas?

I'm sure there is probably a better way to do this, but I'm somewhat new to this game, so I'm just trying things out.

Thanks,
Linus


(possibly?) relevant code bits:
Expand|Select|Wrap|Line Numbers
  1. function validate(selector) {
  2.  ...[snip-validation code]
  3.  document.selectProductForm.submit();
  4. }
  5.  
  6. <form id="selectProductForm" name='selectProductForm'  action="GetFields2.jsp" method="post"
  7.     target="queryFrame">
  8. <input type=hidden name="debug" value="<%= pageDebug %>" />
  9. Product Type:
  10. <select id="productTypeSelect" name="productType" onchange="validate(this)" >
  11. <option selected disabled="disabled" value='unchosen' id='unchosen'>Choose a product</option> <!-- empty -->
  12. ...[more options]
  13. ...[other cruft]
  14.  
  15.   <div class="tab-panes">  
  16.     <div class="content" id="queryPane">
  17.         <iframe name="queryFrame" id="queryFrame" src="blankQuery.html" 
  18.             height="100%" width="100%" >
  19.         If your browser supported iFrames, this would be the Query Pane.</br>
  20.         </iframe>
  21.     </div>
  22.     <div class="content" id="resultsPane">
  23.         <iframe name="resultsFrame" id="resultsFrame" src="blank.html" 
  24.             height="100%" width="100%">
  25.         If your browser supported iFrames, this would be the Results Pane.</br>
  26.         </iframe>
  27.     </div>
  28.   </div>
  29. </div>
  30.  
May 16 '07 #1
4 11704
I still don't know the answer to the multiple posts question, but if anyone cares, I used the iframe.location.replace method to update the iframe contents. Works much better.
May 16 '07 #2
iam_clint
1,208 Expert 1GB
not sure what would cause that problem
May 16 '07 #3
I still don't know the answer to the multiple posts question, but if anyone cares, I used the iframe.location.replace method to update the iframe contents. Works much better.

i read ur issue that you were haveing and I am having a issue somewhat like that. Im using C# in the backend and I want the iFrame src to change to what ever the textbox is i.e www.google.com or what ever in regards to websites. If you can helpme with that issue it would be great. thank you in advance
Oct 16 '07 #4
gits
5,390 Expert Mod 4TB
hi ...

post some html-and js-code regarding to your problem ... you have a textbox where a user may enter an url? and on click or enter or whatever the displayed page of an iframe should change to that url?

kind regards
Oct 17 '07 #5

Post your reply

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

Similar topics

3 posts views Thread by Robert Atkinson | last post: by
2 posts views Thread by Daniele Baroncelli | last post: by
3 posts views Thread by mike | last post: by
1 post views Thread by SP | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.