简体   繁体   中英

Joomla JHTML::calendar input validation

I'm using 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM