How get javascript var value?

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

I have a javascript calculator. How do I pass the value of the calculator
result to another ASPX page so that I can right some VB.NET against the
value?

Thanks!
 
Do you want to send the user to the page or have it occur in the background,
leaving the calculator open?

To accomplish the first, you would either have a form with a submit button,
and alter the URL that it is posting to or manipulate some hidden variables.

If you wanted to do it behind the scenes, you could have a frame or iframe,
and when you want to call the aspx page, change the src of the frame to be
the ASPX page url with some querystring value representing the value that you
want to pass.

Hopefully that will help you out or give you some ideas.

Thanks,
Ian Suttle
http://www.IanSuttle.com
 
Thanks for the response.

Actually it's a keypad for logging in. If they enter the correct sequence
of numbers it goes onto the secured page.

The end result I want is this: The user will punch in the keycode,
javascript building the string as they enter it, then when they click on a
button it submits it to the server for verification and either the user is
given a warning ("bad passcode") or is redirected to the secure page.

So, I guess I could build the string (using js) then when they "submit" it
then send the var string in the querystring to the aspx page. I think
that's kind of what you were thinking.

Thanks!
 
Yeah, that is the basic idea of it.

If you are using it as a passcode, for security purposes you may want to
send it as a post variable (coming from a hidden field) that you would
populate as the keys were pressed like you had described.

If you need to bounce more ideas about it, let me know.

Thanks,
Ian Suttle
http://www.IanSuttle.com
 
I'm new to javascript. Any sample code, links, etc on how to do this?

Thanks again!
 
Back
Top