Hopefully a simple question

Results 1 to 3 of 3

Thread: Hopefully a simple question

  1. #1
    Join Date
    Dec 1969

    Default Hopefully a simple question

    How do I go about populating a server side variable with the value from a client side function or variable? Thanks for any help.

  2. #2
    Ed Guest

    Default RE: Hopefully a simple question

    The easiest way would be to put the variable&#039s value into a hidden text field or into the querystring.<BR><BR>here&#039s the querystring way:<BR>&#060;form onsubmit="transferValue()" method="get"&#062;<BR> &#060;input type="submit" value="submit"&#062;<BR>&#060;/form&#062;<BR>&#060;script language="javascript"&#062;<BR>var myVariable = "thing"<BR>function transferValue() {<BR> window.location = &#039otherPage.htm?value=&#039 + myVariable<BR>}<BR>&#060;/script&#062;<BR>Good Luck!

  3. #3
    Join Date
    Dec 1969
    Los Angeles, CA

    Default Hopefully a simple answer

    You have the value in client side script right??<BR><BR>Like Ed mentioned ther are a lot of ways.<BR><BR>1. like what he mentioned --&#062; assuming ofcourse the code is right<BR><BR>2. YOu can pass it through a Querystring on the form SUBMIT<BR><BR>form.action = "pagename.asp?param1=" & variable name<BR>form.submit()<BR><BR>3. put it into a hidden varuable and submit the form liek you would NORMALLY<BR><BR>form.textboxname.value = variable name<BR><BR>then when you submit the form you will use the request object to get the variable and assign it to a server side variable<BR><BR>You HAVE TO submit the form and get the value you CANNOT assign it in client side script.

Posting Permissions

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