0

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

Mankind1023
  • 7,198
  • 16
  • 56
  • 86

1 Answers1

2

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.

Ashwin Date
  • 301
  • 1
  • 4