Joomla JHTML::calendar input validation
I'm usi开发者_如何学Gong the calendar as a custom field in chronoforms, I can edit the code and did that to make it required, but how can I validate the input?
This is the code I added:
<?
echo JHTML::calendar('','expirydate', 'expirydate', '%Y-%m-%d',
array('size'=>'12',
'maxlength'=>'10',
'class'=>' validate[\'required\']',
));
?>
is there a native way to check the value or to stop people from typing in the box and only using the popup calendar button?
Thanks
You could simply make the calendar field read-only using the readonly="true" attribute. That way you just make the field mandatory and no other validation is needed.
精彩评论