Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

insert form information dynamically

Status
Not open for further replies.
Jun 11, 2007
5
US
I am working on a script that allows my users to log into their email or their junkmail using a single form. Their login information is the same for each. The form action gets changed dynamically for each.

The problem I am having is that I need to somehow dynamically change/add form "input" information to the form when the user pushes either button, but before the form is POST (obviously). So, based upon the button they push to login, specific "static" information will be added to the form before being posted.

I hope this isn't as hard to comprehend as it is to read. Thanks.
 
You can create the likeness of a dynamic form by creating some hidden variables and don't populate them with anything unless you need to.

When you go to submit the form, populate those variables with the extra information you need to send.

Then serverside, based on another value you send with the form, you choose to "grab" that added information.

[monkey][snake] <.
 
The problem I am having is that one of my inputs has to have the name of "action" and value of "login". With me dynamically changing the action based upon a button value using javascript, I am using "document.form.action". I need to include that input only if one of the two buttons is pushed, otherwise it is not needed. Firefox executes the form flawlessly, but IE won't do anything because of the input having the name of "action". Hope this sheds some more light on my problem. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top