Hi guys,
I am working on a form and I encountered a problem. I started with a basic form that is attach to a server, so the rules are fixed. The data names can’t be change. The form is almost working except for 1 part “date of birth”.
This is the code from the basic form for the date of birth;
<input type=“text” name=“txtContactBDay” size=34>
The problem with this is that if someone is writing 12 january 2004 it won’t work, but the user won’t know it. The data sent really needs to be in this specific format… mm/dd/yyyy (eg. 10/25/1982 (the forward-slash are really important in the data too)).
So I changed the script to have some option boxes for the year the month and the day. I am wondering how can I write the script that at the end the data gathered is in the good format mm/dd/yyyy and is named “txtContactBDay”.
Here’s an example of how I scripted the option boxes;
<select name=“month” id=“date” onchange=“return wait_for_load(this, event, function() { editor_date_month_change(this, ‘birthday_day’,‘birthday_year’); });”>
<option value=“na”>Month</option>
<option value=“1”>January</option>…
<select name=“day”>
<option value=“na”>Day</option>
<option value=“1”>1</option>…
<select name=“year”>
<option value=“na”>Year</option>
<option value=“2009”>2009</option>…
Thanks guys !