With version 1.3.5 of CKForms, I was trying to validate phone numbers but I couldn't find how, because the fields only allow validation of text, date, email and number.
I got into the code of the component and I've realized that the validation of telephone numbers was actually there. Thus, I modified the form in which fields are created to accept that kind of validation.
The modified files are:
Administrator:
" administrator/components/com_ckforms/views/ckfield/view.html.php" at line 111
- Code: Select all
$texttypelist[6] = JHTML::_('select.option', 'phone', JText::_( 'Phone' ), 'id', 'cattitle' );
Front-end:
"components/com_ckforms/views/ckforms/tmpl/default.php" at line 244
- Code: Select all
else if ($field->typefield == 'text' && $field->t_texttype == 'phone') {
$validationclass = $validationclass."'phone',";
}
"components/com_ckforms/views/ckforms/tmpl/default.php" at line 275
- Code: Select all
if ($field->t_texttype == 'text' || $field->t_texttype == 'number' || $field->t_texttype == 'email' || $field->t_texttype == 'url' || $field->t_texttype == 'phone')
I hope that this contribution is helpful