开发者

Joomla JHTML::calendar input validation

开发者 https://www.devze.com 2023-04-11 15:43 出处:网络
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?

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号