verify text field is not empty before submit
Posted on 2008-09-30
I have a text field
<input type="text" name="date" id="data" size="12" readonly onclick="popupcalendar('mydata')" />
which when clicked pops up a calendar. Below that is a submit button..
<input type="submit" name="submit" value="" class="submit"/>
If I click submit and the user has selected a date then no problem...if I click submit with no date is selected then it throws an error.
How can I verify that the user has selected a date (or the textbox is not empty) before going ahead with the submit....
All I'm really looking for is a simple alert box saying "Please select a date"