1779 Posts in 582 Topics by 556 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 914 Views |
-
Custom form with custom validation

25 August 2010 at 2:19pm
Hello,
I am implemented a custom form with a custom template and it works fine.
Besides other fields, the form has two phone number fields. I need to implement a validation "Input at least one phone number".
How do I go about this?
Thanks,
Jatinder -
Re: Custom form with custom validation

26 August 2010 at 4:56pm
Would appreciate some help. Please respond!
-
Re: Custom form with custom validation

26 August 2010 at 7:38pm
Hi
Hope this will help you
function submit($data, $form) {
if(empty($data['tel_1']) && empty($data['Tel_2'] ) ) {
$form->addErrorMessage("tel_1",_t("ContactForm.TELEPHONEERROR","Please enter at least one Tel number."),"bad");
// Load errors into session and post back
Session::set("FormInfo.Form_ContactForm.data", $data);
return Director::redirectBack();
}this should work
PAt
| 914 Views | ||
|
Page:
1
|
Go to Top |


