passsing javascript variables

Results 1 to 4 of 4

Thread: passsing javascript variables

  1. #1
    oilivier Guest

    Default passsing javascript variables

    How can I pass a javascript variable to a asp variable so that I can insert the variables in to a database.My javascript variables are screen.width and screen.height.<BR> Thanks for the answers<BR>Olivier

  2. #2
    Join Date
    Dec 1969

    Default RE: passsing javascript variables

    I&#039;ve found that the easiest way to do that is to put the javascript variables into hidden text boxes on a form. When you submit the form, you can get those values from the request.form collection in asp and insert them into the database

  3. #3
    olivier Guest

    Default RE: passsing javascript variables

    I actually did exactly the same thing but is there any other way,because I do not want the user to submit a form.<BR>Olivier

  4. #4
    Join Date
    Dec 1969

    Default client to server

    The JavaScript variables are client-side, and can&#039;t be passed to ASP variables on the same page, because the ASP variables are server-side. The only way to pass a JavaScript variable to an ASP variable is by passing it to the next page via a form or a querystring. Depending on how you are getting to the page that will update the database, you could include JavaScript that will submit a form with hidden values when the user clicks a link, if you don&#039;t want them to actually have to submit a form.

Posting Permissions

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