Gary Samuels
asked on
Single text input for 2 forms?
Is it possible to use a single text input for both of the following forms?
The first form saves data to a cookie, the second retrieves the data so they can't be combined.
<form method="post" action="http://mydomain.com>
<input type="text" name="myemail" value="" size="20">
<input type="hidden" name="save" value="1">
<input type="submit" value="Save" class="button" />
</form>
<form method="post" action="http://mydomain.com>
<input type="text" name="myemail" value="" size="20">
<input type="hidden" name="Action" value="NEW">
<input type="hidden" name="SubScreen" value="TKRESTORE">
<input type="hidden" name="tksaved" value="email">
<input type="submit" value="Restore" class="button" />
</form>
The first form saves data to a cookie, the second retrieves the data so they can't be combined.
<form method="post" action="http://mydomain.com>
<input type="text" name="myemail" value="" size="20">
<input type="hidden" name="save" value="1">
<input type="submit" value="Save" class="button" />
</form>
<form method="post" action="http://mydomain.com>
<input type="text" name="myemail" value="" size="20">
<input type="hidden" name="Action" value="NEW">
<input type="hidden" name="SubScreen" value="TKRESTORE">
<input type="hidden" name="tksaved" value="email">
<input type="submit" value="Restore" class="button" />
</form>
Yes
ASKER
I guess I should have said, "How do I use a single text input for both of the following forms?"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so i replace the text input of the first form with the above and change the second text input to a hidden input?
I guess you could make it hidden if you want, but that would then mean you have a form with no visible inputs except a submit button and that makes no sense to me. But what you are doing does not make much sense anyway. as soon as one of the submit buttons is fired the other form is no longer available for submission anyway.
They both have the same action, so if they are going to the same place, I cannot think of anything that should dictate them not being combined as a single form.
The whole thing looks pretty strange to me.
Cd&
They both have the same action, so if they are going to the same place, I cannot think of anything that should dictate them not being combined as a single form.
The whole thing looks pretty strange to me.
Cd&