• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Changing the target of a form

 
Ranch Hand
Posts: 515
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 )
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic