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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Souteast Coast
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts

    detecting if user clicked back (i think)

    Hello members,

    I have a script that controls two selectboxes, day and month;
    this script takes today's date and it fills a date selectbox with only the number of days of the month and preselects today's month and day. If a user selects lets say february, then script repopulates the date selectbox with number days of that month.

    Problem; unlike static selectboxes and textboxes, where a user clicks back, what was entered/selected stays entered/selected.. On the hand the script will run with today's dates reloading the date selections.

    Is there a way to stop it from reloading the selections or saving the selections.

    Maybe the only way to do this is cgi or cookies, maybe sessions. dunno that's why im asking.....

    Thanks,
    Hogtied

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The way to go is using cookies. Save the selection in a cookie and onload of the page, check the cookie and select the item based on the value of the cookie, if cookie doesn't exist, select the default item.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Souteast Coast
    Posts
    124
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by glenngv
    The way to go is using cookies. Save the selection in a cookie and onload of the page, check the cookie and select the item based on the value of the cookie, if cookie doesn't exist, select the default item.
    I figured one of those things now!?! I've tried many times to create a cookie from javascript. or maybe it can only be done in cgi's

    I used document.cookie(variables) and that doesn't seem to work.

    I have even copied some cookie codes here at the forum on a blank HTML page and still can't get it to work..

    Any clues, suggestions, or know how's

    Thanks for responding,
    Hogtied


  •  

    Posting Permissions

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