|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Speeding Shipping, Improving Compliance – Read the ScanCode Systems Case Study |
|
#1
|
|||
|
|||
|
Transfer javascript value to ASP Session
I have a page which have many fields that are going to be submitted, and because of that I'm using some javascript that make me able to show/hide the fields so that I don't have to scroll to much. After I submit the show/hide javascript hides everything.
Therfor I'm wondering how I can transfer the value of the javascript to a session or cookie, and then use this again in a body onload script. PHP Code:
As you see in this example I show/hide product. I have several similar scripts like this on the page with the values product, information, producer etc. It's those values I need to grab and put into a session or something and use that value in a body onload script. |
|
#2
|
|||
|
|||
|
http://www.webreference.com/js/column8/
That article there will show you how to set and get cookies with Javascript. As for setting them with ASP and getting them with JavaScript, I'm not sure if thats possible. You can do it indirectly this way though: Make a new form, with a few invisible fields for each cookie value. With the method set to get. Call the "document.formName.submit();" function and it will submit the form to the querystring, which can be read by ASP and set into sessions. |
|
#3
|
||||
|
||||
|
nkunicki is correct. You cannot set ASP cookies from Javascript. You have to remember that Javascript is CLIENT side, whereas ASP is SERVER side. So many people get confused by this.
You can however set the cookies from Javascript, which would be the most logical option. Here's how. EDIT: lol - just noticed that nkunicki posted the same link. |
|
#4
|
|||
|
|||
|
Thanks, I will try that.
|
|
#5
|
|||
|
|||
|
Cool
You guys are good, i will try that... thx
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Transfer javascript value to ASP Session |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|