Accessing form variables

Results 1 to 2 of 2

Thread: Accessing form variables

  1. #1
    Join Date
    Dec 1969

    Default Accessing form variables

    How can I access form variables if a page is post through a link instead of a submit button. I have the following code:<BR><BR>&#060;FORM METHOD="post" NAME="X" ACTION="Y.ASP"&#062;<BR>&#060;INPUT TYPE=hidden NAME=&#039;test&#039; VALUE="something"&#062;<BR>&#060;A href="y.asp"&#062;Click Here&#060;/A&#062; <BR>&#060;INPUT id=submit1 type=submit value=Submit name=submit1&#062;<BR>&#060;/FORM&#062;<BR><BR>if I use the submit button to post and access the variable "test" in y.asp as <BR><BR>request.form("test") <BR><BR>then it show me the proper value. But if I use the link "click here" to submit and then use<BR><BR>request.form("test") <BR><BR>again, it shows me nothing. How can I access that variable. I have a case where I have link to lots of record with a unique ID. and I just send the user to the same page with the corresponding ID as a query string. But for some reason I want to access the hidden field also. How can I do that...<BR><BR>thanks.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Accessing form variables

    make your link submit the form or you can append your fields to the querystring, then you can get the values by:<BR>request.querystring("FORM_ELEMENT")<BR><BR> to make a link submit the form, do the following:<BR>&#060;a href="javascript:document.formname.submit()"&#062; submit it here&#060;/a&#062;<BR><BR>justin

Posting Permissions

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