Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I would appreciate seeing a simple example of using this module to require a user to enter a number in a field. That's all I want to do. Nothing fancy. Something like this:
$form['amount'] = array(
'#type' => 'textfield',
'#required' => true,
'#title' => t('Amount'),
);
Assuming that I have enabled the Clientside Validation and Clientside Validation Form modules, what do I have to add to this element array to get the number validation?
Thanks.
Comments
Comment #1
attiks CreditAttribution: attiks commentedYou can try the following, or use the elements module to enable html5 number field
Integer
Decimal
Comment #2
attiks CreditAttribution: attiks commented