473,379 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 14258
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joe | last post by:
I am new to web development at all but maintaining a .NET site that utilizes .apsx pages using vbscript, javascript,and C#. There is a function I am doing that I only can find out how to do in...
0
by: SteveS | last post by:
Hello, this problem is driving me nuts! I am using the Content Ratings (RSACi) for my website. The settings strictly "G" rated - No violence, sex, nudity or offensive language. I have a user...
3
by: M Wells | last post by:
Hi All, Just wondering how you go about changing the value of a session cookie via javascript? I have a PHP page that sets a session cookie when it first loads. I'd like to be able to change...
6
by: -D- | last post by:
I'm trying to accomplish the following. I'm trying to get the values for the table rows that are dynamically created to persist through a redirect. Referring URL:...
2
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click...
3
by: Enoch Chan | last post by:
I would like to set a Session variable to a value. In Vbscript it should be Session("ZoomValue")=500 How can I set this session variable by using Javascript? Thanks
2
by: Joe Molloy | last post by:
Hi, This isn't a mission critical question but I thought I'dl throw it out there for your feedback as it's a bit curious. I have developed a shopping cart for an application I'm working on...
5
by: rockdale | last post by:
Hi, all: I have a linkbutton and I use javascript to open another webpage in a new window. I also want to set my session variable value when this linkbutton get clicked. These session variable...
4
by: philin007 | last post by:
Hi , I have the following javascript codes: ****************************************** <script language="JavaScript"> <!-- .... ..... if (nextRow >5) {
10
by: sheldonlg | last post by:
Something weird is happening here. I inherited some code that looks like what is shown below. The problem is that when menu1.php is included, the session variables are not known in homepage.php. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.