469,275 Members | 1,871 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Session Variable in JavaScript ?????

mhk
Hi,

Is there any way to create/set Session veriable in JavaScript.

Please let me know if anyone has an idea.

Thanks alot.

Jul 23 '05 #1
7 14089
"mhk" <mh*@nonexistant.com> skrev i meddelandet
news:10*************@corp.supernews.com...
Hi,

Is there any way to create/set Session veriable in JavaScript.

Please let me know if anyone has an idea.

Thanks alot.


No (for standard Ecma-script, AFAIK).

Cookies?

Joakim Braun
Jul 23 '05 #2
mhk


Joakim Braun wrote:
"mhk" <mh*@nonexistant.com> skrev i meddelandet
news:10*************@corp.supernews.com...
Hi,

Is there any way to create/set Session veriable in JavaScript.

Please let me know if anyone has an idea.

Thanks alot.

No (for standard Ecma-script, AFAIK).

Cookies?

Joakim Braun

************************************************** *
Well.. i actually want to pass a value calculated in javaScript to be
used in VbScript.

I mean, when i click a button in ASP page, it calls a JavaScript form
validation function, i that javascript function, i have calculated a
value which i want to access in my VBScript so that i can pass it to
next page after javascript validation.

any idea to handle this situation.

Thanks

Jul 23 '05 #3
"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...


Joakim Braun wrote:
"mhk" <mh*@nonexistant.com> skrev i meddelandet
news:10*************@corp.supernews.com...
Hi,

Is there any way to create/set Session veriable in JavaScript.

Please let me know if anyone has an idea.

Thanks alot.

No (for standard Ecma-script, AFAIK).

Cookies?

Joakim Braun

************************************************** *
Well.. i actually want to pass a value calculated in javaScript to be
used in VbScript.

I mean, when i click a button in ASP page, it calls a JavaScript form
validation function, i that javascript function, i have calculated a
value which i want to access in my VBScript so that i can pass it to
next page after javascript validation.

any idea to handle this situation.


Put the calcualted value in a hidden form field, and submit it to the server

--
Dag.
Jul 23 '05 #4
mhk


Dag Sunde wrote:
"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...

Joakim Braun wrote:

"mhk" <mh*@nonexistant.com> skrev i meddelandet
news:10*************@corp.supernews.com...
Hi,

Is there any way to create/set Session veriable in JavaScript.

Please let me know if anyone has an idea.

Thanks alot.
No (for standard Ecma-script, AFAIK).

Cookies?

Joakim Braun


************************************************ ***
Well.. i actually want to pass a value calculated in javaScript to be
used in VbScript.

I mean, when i click a button in ASP page, it calls a JavaScript form
validation function, i that javascript function, i have calculated a
value which i want to access in my VBScript so that i can pass it to
next page after javascript validation.

any idea to handle this situation.

Put the calcualted value in a hidden form field, and submit it to the server

************************************************** **
Yes ... u r right but the thing is that the calculated value is in form
validation JavaScript function. So... how can i pass that calculated
value through hidden field in a ASP page.

any idea????.

Jul 23 '05 #5
"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...


Dag Sunde wrote:
"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...

Joakim Braun wrote:
"mhk" <mh*@nonexistant.com> skrev i meddelandet
news:10*************@corp.supernews.com...
>Hi,
>
>Is there any way to create/set Session veriable in JavaScript.
>
>Please let me know if anyone has an idea.
>
>Thanks alot.
No (for standard Ecma-script, AFAIK).

Cookies?

Joakim Braun

************************************************ ***
Well.. i actually want to pass a value calculated in javaScript to be
used in VbScript.

I mean, when i click a button in ASP page, it calls a JavaScript form
validation function, i that javascript function, i have calculated a
value which i want to access in my VBScript so that i can pass it to
next page after javascript validation.

any idea to handle this situation.

Put the calcualted value in a hidden form field, and submit it to the server

************************************************** **
Yes ... u r right but the thing is that the calculated value is in form
validation JavaScript function. So... how can i pass that calculated
value through hidden field in a ASP page.

any idea????.


In your form:

...
<input type="hidden" name="myHiddenField" id="myHiddenField" />
...

In your validation script:

...
var hiddenField = document.getElementById("myHiddenField");
hiddenField.value = calculatedValue;
...

In your .ASP script

...
theHiddenValue= Request.Form("myHiddenField")
...

--
Dag.
Jul 23 '05 #6
mhk


Dag Sunde wrote:
"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...

Dag Sunde wrote:

"mhk" <mh*@nonexistant.com> wrote in message
news:10*************@corp.supernews.com...
Joakim Braun wrote:

>"mhk" <mh*@nonexistant.com> skrev i meddelandet
>news:10*************@corp.supernews.com...
>
>
>
>>Hi,
>>
>>Is there any way to create/set Session veriable in JavaScript.
>>
>>Please let me know if anyone has an idea.
>>
>>Thanks alot.
>
>
>No (for standard Ecma-script, AFAIK).
>
>Cookies?
>
>Joakim Braun
>
>

********************************************** *****
Well.. i actually want to pass a value calculated in javaScript to be
used in VbScript.

I mean, when i click a button in ASP page, it calls a JavaScript form
validation function, i that javascript function, i have calculated a
value which i want to access in my VBScript so that i can pass it to
next page after javascript validation.

any idea to handle this situation.
Put the calcualted value in a hidden form field, and submit it to the


server
************************************************ ****
Yes ... u r right but the thing is that the calculated value is in form
validation JavaScript function. So... how can i pass that calculated
value through hidden field in a ASP page.

any idea????.

In your form:

...
<input type="hidden" name="myHiddenField" id="myHiddenField" />
...

In your validation script:

...
var hiddenField = document.getElementById("myHiddenField");
hiddenField.value = calculatedValue;
...

In your .ASP script

...
theHiddenValue= Request.Form("myHiddenField")
...

********************************************
Its working. Thank you Sooooooooo Much.

Jul 23 '05 #7
Don't use cookies, you can URL encode them to the next page.

Jul 23 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by M Wells | last post: by
6 posts views Thread by -D- | last post: by
3 posts views Thread by Enoch Chan | last post: by
2 posts views Thread by Joe Molloy | last post: by
5 posts views Thread by rockdale | last post: by
10 posts views Thread by sheldonlg | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.