Please Mods don't kill me, I have already posted this question in the Beginners Forum but I was told over there to ask the question over here. So I'm posting it here again.
"I want to make a form for my users where they can submit deals. On the form there is a drop down menu for Exp. dates, for the dd/mm/yy. My question is how can I make that the default exp. date should change every day according to that date. If you want to see what I'm talking about you can give a look on the form at my site at http://jumpondeals.com/submitdeals.htm (right now the form is set to 11/21/00 but it doesn't change automatically).
Don't wander around in my site cause it's still under construction."
You should put the above in a function and call it with the onLoad event handler in the body tag. (If you leave it outside a function, there is a good chance, you'll end up with an object undefined or has no properties message.)
If you want to insert the current date, you can use some of the code in the following thread (posted by one of the other moderators: westmich)
1) dependent upon how your selection list looks and is implemented, you may have to execute a reload() for netscape to redraw the screen.
2) You can also place the function directly after the selection list tag, or document.write the option in its appropriate place on the page.
Edited by Vincent Puglia on 11-21-2000 at 09:38 PM
Hi, sorry for the link failure it was my problem as I have changed that file name, but I have corrected it now. On that page you'll see a drop down menu for the exp. date. What I want is that the default date which is filled in automatically in the drop down menu should change every day according to that days date.
Thank you so much Vincent Puglia, but can you please explain to me better what to do?
Thank you so much etlux. Do I have to enter somewhere today's date, or it takes the date from the server?
Also if I want to set the form in a way that the date should appear one day later than the current date i.e. on November 23, the form should show November 24, what should I do? (The reason why I want it this way is because an exp. date will usually not be entered for the same day).
I'm not on my primary machine, so I can't upload the code; but, if I remember right, it does work -- though the last method call may be setDate() (?) in the (yyyy,mm,dd) format. If I'm still awake when I get home, I'll check.