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!

HTML Form question.

Status
Not open for further replies.

ironmunk

Technical User
Aug 21, 2001
51
CA
Hi, I have a problem

Here is my situation. I have 1 html page, this html passes 4 hidden values to another html form (without problems).

On my second html page, this is a registration page. It asks for Name, DOA and occupation.

Name is a text field. The occupation is a dropdown list and the DOB consists of 3 dropdown lists (yr, month, day).

The dropdown list all have values assigned to them.

1 of my questions is how can I assign those values on this page to a hidden value to be tranfered to another html page?

<INPUT TYPE=&quot;hidden&quot; name=&quot;Occupation&quot; VALUE='document.form1.txtoccupation.value'>

I tired that line, but it doesn't seem to work.

I am trying all this under 1 form.

my second question is how can I make the yr, month and day for DOB into 1 variable so only that is passed.

I've been trying this for a few days, any help would be appreciated.
 
if you're using JavaScript you can put an onblur or on submit handler in your fields.
<input type = &quot;text&quot; name = &quot;txtoccupation&quot; onblur = &quot;document.form1.hiddenoccupation.value == document.form1.txtoccupation.value&quot;>
but why would you want to pass two form fields of the same value to the next page?
you can do the same with the date fields, on submit concantinate the values into one hidden field.


thereptilian120x120.gif
 
You'd have to handle all of this in your cgi program. Aren't you already doing this when you pass the values from the hidden fields from the first form to the second? I'm assuming your cgi program that generates the second form is receiving the values from the first form and putting them in hidden fields in your second form. You'd do pretty much the same thing for the next form. Get the values from the name text field and occupation drop-down and put those as the values for the hidden fields on the next form. Get the values from the drop-downs for DOB, merge them together in your cgi program and use that as the value for the other hidden field. The specifics are going to depend on what language you're using for your cgi program(s).

 
Thanks for hte quick replies.

Bombboy, I will try your suggest and let you know.

The reason i am passing data over 2 forms is the following

a) Form 1 allows the user to pick which date they wish to attend an event. The values passed here are the values needed by the payment system
b) Form 2 allows the user to enter in all the vitals about themselves.
c) the values on these 2 forms get passed onto my payment system and get returned back to my php scrip which take the data and inputs it into my system.

my payment system will only allow me to pass 5 variables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top