Pls Help: JS for writing a cookie from a form

B

Branner1

Hi there,

I have a nice form working in which JS is used to "remember" the
values a user enters in various fields. My problem is:

- In the code, when the inital form tag is simply
<FORM NAME="infoForm"> .... </form> the cookies work great.

- However when the tags look like this (necessary for submitting to
cgi:)

<FORM NAME="infoForm" METHOD="POST" ACTION="http://.../*.cgi"> ....
</form>

The cookie does not work at all. Anyone have an idea why? Thanks in
advance...

-- Mike
 
J

Jeff North

On 9 Oct 2003 16:28:25 -0700, in comp.lang.javascript
| Hi there,
|
| I have a nice form working in which JS is used to "remember" the
| values a user enters in various fields. My problem is:
|
| - In the code, when the inital form tag is simply
| <FORM NAME="infoForm"> .... </form> the cookies work great.
|
| - However when the tags look like this (necessary for submitting to
| cgi:)
|
| <FORM NAME="infoForm" METHOD="POST" ACTION="http://.../*.cgi"> ....
| </form>
|
| The cookie does not work at all. Anyone have an idea why? Thanks in
| advance...

Be careful when using cookies for storing input data. Cookies do have
a size limit (1024 bytes if memory serves me correctly). Also the user
may have cookies disabled.

Since you are using the POST method on the form it is easier for the
cgi app to pick up these values anyway. Your cgi app would need to use

var1 = Request.Form("myvar1")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top