southbeach
Programmer
I need a script where I can create a date based on a given string. The string is expected to be something like
+###
Where the + sign tells the script to add and ### is the number of days from today.
So, if user typed +2 on a field, onBur will call the JS script/function passing this.value. The JS script should check for + to be 1st character - If there, the field should be populated with the date after adding ### days to current date.
So, +2 should result on 04/10/08 since today's date is 04/08/08.
I can write this in PHP but I do not know enough JS - Hope you guys can help me here.
Thanks!
+###
Where the + sign tells the script to add and ### is the number of days from today.
So, if user typed +2 on a field, onBur will call the JS script/function passing this.value. The JS script should check for + to be 1st character - If there, the field should be populated with the date after adding ### days to current date.
So, +2 should result on 04/10/08 since today's date is 04/08/08.
I can write this in PHP but I do not know enough JS - Hope you guys can help me here.
Thanks!