JS and Hidden Fields

Results 1 to 2 of 2

Thread: JS and Hidden Fields

  1. #1
    Join Date
    Dec 1969

    Default JS and Hidden Fields

    I&#039;m having problems and hope someone can help. In my form when the user clicks submit I have js code that adds items to a cookie. I would like to take the items from the cookie or the js variable and put it in a hidden field in my form. So when the page submits and runs the asp code it will take the hidden fields and put them in variables so I can use them in asp for other manipulation. I&#039;m having a hell of a time trying to figure it out. <BR><BR>What would my hidden field look like?<BR>like this: &#060;input type=hidden name=hiddenname value=JSVariable&#062;<BR><BR>Can someone please help.<BR><BR>thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: JS and Hidden Fields

    &#060;input type=hidden name=hiddenname value="whatever"&#062;<BR><BR>Then, in your click or wherever you want, just set it<BR><BR>&#060;SCRIPT ...&#062;<BR>document.formname.hiddenname.value = yourJSVariable;<BR>&#060;/SCRIPT&#062;<BR>

Posting Permissions

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