Avatar of Gary Samuels
Gary Samuels
Flag for United States of America 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>
HTML

Avatar of undefined
Last Comment
COBOLdinosaur

8/22/2022 - Mon
Ishaan Rawat

Yes
Gary Samuels

ASKER
I guess I should have said, "How do I use a single text input for both of the following forms?"
ASKER CERTIFIED SOLUTION
COBOLdinosaur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Gary Samuels

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 started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
COBOLdinosaur

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&