Results 1 to 4 of 4

Thread: Recall Form Values script II - use with <textarea> ...?

  1. #1
    Join Date
    Oct 2005
    Location
    Liverpool, UK
    Posts
    87
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Recall Form Values script II - use with <textarea> ...?

    Recall Form Values script II

    http://www.dynamicdrive.com/dynamici...mremember2.htm

    I'd like to get this working with some <textarea> values.

    Due to the layout on my page, I can't use the <input type ="text"> method, I need to set up a "textarea" type input instead.

    Is it possible to amend the above script to include <textarea> values or is there a way I can copy my textarea value into an input type="text" value, then recalling it later from the cookie - effectively copying it back into the <textarea> value back on the page...?

    Thanks in advance,

    N.

  2. #2
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    The reason for the script not supporting the TEXTAREA element is because large amounts of text may be entered into it. The script relies on JavaScirpt cookies to save the information entered, which has a size limit of just 4kb per domain (all cookies added together). So it's not a good idea in general to use this script on textareas unless you have a way of enforcing the amount of text that gets entered by the user.

    Having said that, you should be able to disable the script from checking the field type by removing the line:

    Code:
    if (this.fields[i].type=="text")
    entirely, plus the part in red in the below:

    Code:
    if (cookievaluepair[i].split(":")[0]!="toggleboxid" && this.getfield(cookievaluepair[i].split(":")[0]).type =="text" )

  3. #3
    Join Date
    Oct 2005
    Location
    Liverpool, UK
    Posts
    87
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile

    Understood!
    Thanks for the speedy reply.
    Appreciate the reasons why you wouldn't use this 'normally' with <textarea> - it's just something I've got to do in isolation on a small intranet site .... as I can't, on this occasion, store responses to a db.

    I wasn't aware there was a 4k limit (total) on cookies. Is this a 'default' thing or can this be fine tuned machine by machine. If so, I have a fixed/limited number of users utilising the Form and I could, possibly, enhance this for them???

    Cheers,
    N.

  4. #4
    Join Date
    Aug 2004
    Posts
    9,878
    Thanks
    3
    Thanked 962 Times in 951 Posts
    Blog Entries
    15

    Default

    Nope, the cookie limit is hard coded into the browser, and most browsers have a 4kb limit I believe.

Bookmarks

Posting Permissions

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