Home » HTML » HTML_QuickForm » Bug #5701
Day of Month should be Text field
Details
| Submitted | 2005-10-16 15:00 UTC |
|---|---|
| From | askwersky at comcast dot net |
| Status | Wont fix |
| Package | HTML_QuickForm |
| PHP Version | 5.0.0 |
| OS | Mac OS X/Any |
| Roadmaps | (Not assigned) |
Comments
[2005-10-16 15:00 UTC] askwersky at comcast dot net
Description:
------------
The day of the month is always 1-31 in the select menu. This allows incorrect dates to be entered (i.e. September 31).
To correct this, the day of month should probably be a small text entry field with JavaScript or Server side validation of the day. Using a select menu obviously makes it difficult to make this field 'validate-able'
I am aware of "request #2225" and I think the solution provided is inadequate.
[2005-10-16 17:56 UTC] mansion at php dot net
Using a text input allows for even more errors.
Simply use a validation rule that would call the checkdate() php function:
function checkdate($value)
{
if (checkdate($value['M'], $value['d'], $value['Y'])) {
return true;
}
return false;
}
$form->registerRule('checkdate', 'callback', 'checkdate');
$form->addRule('mydate', 'Incorrect date', 'checkdate');
[2005-10-17 03:12 UTC] askwersky at comcast dot net
How does it add more errors to change the select into a
text field? You mean the user could type in something
non-numeric? I think it is worth that risk. Its
confusing to have something be on a menu but then not
let the user select it. Putting a value on a select
implicitly says to the user "this value is OK".