form- cookies in asp page

Discussion in 'C#' started by drago85, Jun 13, 2008.

  1. #1
    i have an asp page with a form:

    the username field must have the last user who connected ( saved using cookie)
    When i press the "cancel " botton of the form this username should disappear and appear again once i close and open the browser again

    I have a problem doing it:
    I wrote :
    <form name="nuovo" method="post" action="B.asp" onSubmit="return control(nickname.value,password.value); ">

    <H2>Insert username</H2>
    <p ><input type="text" name="nick" value="<%iResponse.write(Request.cookies("lastuser"))%> "> </p>
    <H2>insert password</H2>
    <p ><input type="password" name="password" value=""> </p>

    <p ><input type="Submit" name="create" value="Log!">
    <input type="reset" value="Cancella"> </p>
    </form>

    done like this it doesn't cancel the nick value once i press cancella

    if i write in che nick value:


    value="<%if(Request.Form("cancel")=="Cancella") {Response.write(Request.cookies("lastuser"))}%> ">

    and in the cancel botton:
    <input type="reset" name= "cancel" value="Cancella">

    it always puts it empty :(

    Can anyone help me????
    thanks!!

    ps. I am writing on ASP pages using javascript
     
    drago85, Jun 13, 2008 IP
  2. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #2
    ="<%iResponse

    I see an extra "i"

    Regards

    Alex
     
    kmap, Jun 13, 2008 IP
  3. drago85

    drago85 Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks but nothing changes .... :(:(:(
     
    drago85, Jun 13, 2008 IP
  4. mazzetta

    mazzetta Peon

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It seems you are telling the script to actually SHOW the cookie if some1 press cancel.
    Change to:

    By the way I don't remember how the reset button is treated... if it works like you think, this should work.
     
    mazzetta, Jun 15, 2008 IP