By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,963 Members | 1,474 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,963 IT Pros & Developers. It's quick & easy.

How get javascript var value?

P: n/a
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!
Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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

"VB Programmer" wrote:
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!

Nov 18 '05 #2

P: n/a
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!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
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

"VB Programmer" wrote:
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!

Nov 18 '05 #3

P: n/a
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

"VB Programmer" wrote:
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!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
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

"VB Programmer" wrote:
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!


Nov 18 '05 #4

P: n/a
I'm new to javascript. Any sample code, links, etc on how to do this?

Thanks again!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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

"VB Programmer" wrote:
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!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
> 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
>
> "VB Programmer" wrote:
>
>> 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!
>>
>>
>>


Nov 18 '05 #5

P: n/a
Sure thing. This is a simplified version, but something like this would work:

<script>
function setCode(val){
document.formCode.txtCode.value += val;
}
</script>

<body>
<form name="formCode" method="post" action="checkCode.aspx">
<input type="hidden" name="txtCode" value="">
<input type="button" value="1" onClick="setCode(1);">
<input type="button" value="2" onClick="setCode(2);">
<input type="submit" value="Check Code">
</form>
</body>

When one of the buttons are clicked, it will add to the code that is being
stored in the hidden input variable. Once you submit the form, the hidden
value will go along with it, and you can look at that to verify the code that
they entered.

Does this all make sense?

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

Thanks again!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:03**********************************@microsof t.com...
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

"VB Programmer" wrote:
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!

"Ian Suttle" <Ia*******@discussions.microsoft.com> wrote in message
news:BB**********************************@microsof t.com...
> 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
>
> "VB Programmer" wrote:
>
>> 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!
>>
>>
>>


Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.