using a form to submit to db and set field values to cookies

R

Rachel Kinder

I am trying to get my form values to both submit to the
database and set some of the field values to cookies. I
have no problem submiting to the db, and I have no
problem setting the cookie to say something
like "abcdef", but when I try to set the cookie value to
the text field value, it does not work. I don't receive
any errors, it just doesn't set. I think that I may have
the code in the wrong place. Any help would be
appreciated. I have tried several scenarios ( onchange
of the field, onsubmit of the form, in the form action )
What am I doing wrong??? ( code I'm using is
Response.Cookies("CookieName")
=Request.FormName"Fieldname")
 
M

MD WebsUnlimited.com

Hi Rachel,

I'm assuming that you modified the DIW code to set the cookies.

The code would be:
response.cookies("KeyName") = request.form("field1") ' set
the value
response.cookies("KeyName").Expires = dateadd("w",1,now) ' expires the
cookie in 1 week
response.cookies("KeyName").Path = "/"
' the cookie will be visible throughout the web site.

I'll be happy to look at your code if you post it.
 
R

Rachel

Hi Mike,
Yes, that was the code I was using. I did have to do
some 'work arounds' as the problem was resolved when I
made the change from 'Send results to database' to 'Send
to Other' and did the SQL coding in another asp file (
without using Frontpage's DIW ).
Thank you so much, you have been so helpful!!!!
Rachel
-----Original Message-----
Hi Rachel,

I'm assuming that you modified the DIW code to set the cookies.

The code would be:
response.cookies("KeyName") = request.form
("field1") ' set
 

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

Top