Call JS Validation from my Button

BuDuS 22 Feb, 2015
Hi Bob

I have a form with some panel element and button "next" and "previous".
When the user click to "next", one panel is hidden and the next panel is shown.

I need to call "JS Validation" (like the "submit" button) when the user click "next" button.

How can I do this ?

Thanks, Andrea.
GreyHead 23 Feb, 2015
Hi Andrea,

Hmmm . , . I don't know how to do this, Max may have some suggestions. The problem is that I don't know of any way to restrict the validation to the current panel - so you will get lots of errors showing from required inputs in the hidden panels.

Bob

PS Personally, I would probably make a form like this into a multi-page form that looked like tabs or sliders but actually submitted after each page. That gets round several problems including the validation one.
BuDuS 23 Feb, 2015
it's not important to restrict check only at the one panel.

The other panels are hidden and the tooltips errors for incomplete elements are not visible.

I need a function like:

if(form.validation() == false) {
// Next Button return false and do nothing
return false;
} else {
// Hide current panel and show next
....
}

when "form.validation()" is function called from "submit" (and I don't know her name, if she exist).

***

For the "multi-page form" I have the problem to go back.
GreyHead 23 Feb, 2015
Hi Andrea,

Sorry, I've looked at the code but I can’t see what you need to call to get this to work :-(

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