hidden fields

Results 1 to 5 of 5

Thread: hidden fields

  1. #1
    kate Guest

    Default hidden fields

    the user selects an option fron a drop down box from one form, this then gives them several other choices in another drop down box on another form, then they press submit and both the values from the first and second box are then added into a database.<BR><BR>now, i can do all these steps apart from getting the first selection into the database. if i use hidden fields is there a way of putting something in the value box which means it changes everytime and is not a set value??<BR><BR>AHWBGA<BR>Kate

  2. #2
    Join Date
    Dec 1969
    Posts
    1,019

    Default RE: hidden fields

    I&#039m not sure if I interpreted this correctly, so forgive me if I didn&#039t. I take this to mean, you have 3 pages: On pg1.asp, the user selects a value & passes it to pg2.asp, which uses the passed value. You then want the pg2.asp to post the passed value to pg3.asp.<BR>pg1.asp posts myItem to pg2.asp<BR>pg2.asp<BR>&#060;input type="hidden" name="myItem" value="&#060;%=request.form("myItem") %&#062;"&#062;<BR>when you post, the hidden field will post as well as anything else on pg2.asp<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969
    Posts
    43

    Default RE: hidden fields

    That is almost what i meant, sorry for not describing it very well.<BR>What i have got is 2 form fields on pg1.asp, both drop down boxes.<BR>the user selects data from the first drop down box.<BR>Then using the Request.QueryString("formfield1") method a query is carried out on the second drop down box and the selected data is shown.<BR>The user then selects one option in the 2nd box, then on pressing submit the values selected in the first and second drop down boxes should be passed to pg2.asp and added to a database.<BR><BR>Can i use the same method as suggested before??<BR><BR>Thanks very much<BR>katie

  4. #4
    Join Date
    Dec 1969
    Posts
    1,019

    Default RE: hidden fields

    You could do it with the hidden fields or you could do this client side with JavaScript, providing the drop downs aren&#039t extremely large. <BR>Since the user&#039s choice in dropdown1 determines what is shown in dropdown2, you can do this with the onChange event. <BR>An example of the dynamic drop downs is available at:<BR>http://www.coolnerds.com/jscript/dynasele.htm<BR>Sorry, the code is just too darn long to paste here.<BR><BR>4guys has a discussion of dynamic select via JavaScript vs. the hidden field/posting method at:<BR>http://www.4guysfromrolla.com/webtech/061399-1.shtml<BR><BR>


  5. #5
    Join Date
    Dec 1969
    Posts
    43

    Default RE: hidden fields

    GREAT, thanks a lot Leo for all your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •