Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Souteast Coast
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do browsers remeber what you typed in a textbox?

    Hello members,

    I have this understandable desire to figure out how does browsers remember what you typed in a textbox?

    For instance: I type in "speed bikes" then click search. when i click on the back button the textbox still says "speed bikes". What causes this and most important can I do something with it.

    I did a small test something like this

    IF (textbox == "speed bikes")
    {
    document.write("speed bikes")
    }

    WEELLL,, I type in speed bike click search, go back and it doesn't do the document.write

    No idea.......

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it wont do the document.write because its using the cached version of the page, and its displaying it how you left it, with "speed bikes" in the textbox... (erm... thats what i think anyways...)
    redhead

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah that's it; but it's pernitious - the data is there, and can be resubmitted, but if you try to read it through javascript, it returns an empty string!

    But if you go

    textBoxObj.value ="";

    and you trigger it from <body onload, then the box will be auto-cleared when you press back.

  • #4
    New Coder
    Join Date
    Dec 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    can't you just use cookies?
    print="TO Ask Will Unmask The Obvious-Jose 2002";

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    Souteast Coast
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah I thought it had to do something with cache. I just find it unusal that the entered text stays there but the dynamic stuff don't even if you test the cached text.

    I could use cookies but don't know how. I've read up and down this forum and see a repeat of "document.cookie". for some reason even if I copy the script provided by the member, it still doesn't work..


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •