...

View Full Version : detecting if user clicked back (i think)



hogtied
01-10-2003, 06:43 AM
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

glenngv
01-10-2003, 08:10 AM
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.

hogtied
01-10-2003, 09:36 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum