Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing the target of a form

 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to change the target of a form.. How would this be done. ??
-Dale

------------------
What's this H2SO4 doing in my fridge?? ( thud )
 
Sri Nivas
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if u need to change the target to which the form is posted dynamically, then u can do it with javascript.
 
Connie Boyd
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you need to change the action, or the target? Srini's code above changes the action of the form, but if you're trying to send the results of a form to a different frame or window, you could do it by adding the target attribute like so:
<FORM ACTION="MyAction" METHOD="POST" TARGET="ResultsFrame">
Where the target is the name of the frame or window you want the results to be sent to.

[This message has been edited by Connie Boyd (edited May 16, 2001).]
 
Dale DeMott
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to change the target.... not the action. How can I change that in JavaScript. I need it to be dynamic in that way.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dale:
Use this form:
document.myForm.target = "windowName"
That will change the target of the form.
hope that helps
Dave
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic