Forums

2nd position for validation message

p1ngu1n 02 Feb, 2010
Hey guys, it's me again🙂

I've got just one last question till I've got the perfect form🙂

I have a very long form and if you scroll down to the submit button you won't see the validation messages from the fields above. Is there any chance to have the messages also next to the submit button? Or at least a message that not all fields are filled out correctly?

Thanks a lot!
GreyHead 02 Feb, 2010
Hi p1ngu1n,

There's no simple way to do this with the ChronoForms created LiveValidations. If you use Custom LiveValidations you can specify a div for the messages.

I'd be inclined to add a JavaScript snippet tied to an onClick event for the Submit button that searched for LV_INVALID classes and showed an error message near the submit button if it found any.

Bob
p1ngu1n 04 Feb, 2010
Hey,

sorry man but don't get it. I just saw the possibility to do PHP-validation which would be fine with me, BUT🙂

- When I try so send the form and more than one field is not filled out correctly it does only return ONE error. How can I do multiple return?

- Even if I switch of Java-validation is does still check it...


Thanks a LOT!!
GreyHead 04 Feb, 2010
Hi p1ngu1n,

If there's a question in there I missed it. :?

Bob
p1ngu1n 04 Feb, 2010
Yeah😉

- How can I do multiple return with the PHP validation?
- How can I switch off the JS-validation permanently? It doesn't work for me...

Thanks
GreyHead 04 Feb, 2010
Hi p1ngu1n,

You can do multiple return with
<?php
$results_array = array();
if ( !test 1 ) {
  $results_array[] = 'Error message 1';
}
if ( !test 2 ) {
  $results_array[] = 'Error message 2';
}
. . .
if ( count($results_array) ) {
  return implode('<br />', $results_array);
}
?>
But it will return a single list of messages at the top of the page.

To turn off validation I think you need to remove all the validation classes from the Form HTM (and input names from the validation tab).

Bob
p1ngu1n 04 Feb, 2010
It works all fine for me now! The only I'd like to do now is to seperate multiple checkbox answers not by "," but by a break ("<br>"). Is that possible?

Thanks^
GreyHead 04 Feb, 2010
Hi p1ngu1n,

Probably not without hacking the ChronoForms code or writing your own code to handle the arrays,

Bob
This topic is locked and no more replies can be posted.