Assign Javascript Variable to ASP Variable

Results 1 to 5 of 5

Thread: Assign Javascript Variable to ASP Variable

  1. #1
    HW Guest

    Default Assign Javascript Variable to ASP Variable

    How do you assign a value contained within a Javascript variable to a variable created in ASP?

  2. #2
    Sathiya Guest

    Default RE: Assign Javascript Variable to ASP Variable

    Have a hidden variable and store tha javascript value in to that variable and access the variable thru request in ASP<BR>&#060;form name="test"&#062;<BR>&#060;input type="hidden" name="Something"&#062;<BR>&#060;/form&#062;<BR>document.test.Something.value = JavascriptValue<BR>----------<BR>&#060;%=Request("Something") %&#062;<BR>-------------- But remember you should submit the form.

  3. #3
    HW Guest

    Default How to do this without submitting the form?

    How can you do this without having to submit the form?

  4. #4
    Join Date
    Dec 1969

    Default RE: How to do this without submitting the form?

    I&#039m assuming you aret talking about client-side javascript. Remember, once the javascript is executing, the ASP has already been processed by the server; the client-side javascript has no knowledge of anything ASP. In order to get the JS variable back to ASP (the server), you need to re-submit it. I had some trouble with this concept myself. Perhaps what you are attempting has another solution? Let us know,<BR><BR>Good luck!<BR><BR>Mike

  5. #5
    HW Guest

    Default Trying Another Solution

    I will be trying another solution : just sticking w/ pure javascript. I will hard code each form component and call a javascript function. <BR><BR>The reason I wanted to store the Javascript into ASP was b/c I had intended to create a dynamic number of HTML form components. I needed to identify each component uniquely i.e.<BR>1txtBox, 2txtBox, etc. I was planning to keep track of the unique identifier in Javascript and ASP somehow. Also, some of these components are dynamically filled dropdown boxes for which I use Javascript to fill other components depending on the choice selected. I was thinking of manipulating it w/ ASP and javascript somehow, but I&#039ll stick to the javasript solution I have. <BR><BR>Thanks.

Posting Permissions

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