Forums

required fields messages

maxelcat 04 Mar, 2009
Hi

At the moment my form has several required fields, and as the user misses one out a little line of text appears under the box to tell them off.

When I built forms by hand I used to use php so that no errors come up until after the submit button has been pressed. I don't really want to re-write a load of code, if this lovely component can do it for me.

Is there a way to get the form to pop up these error messages only when the user hits the submit button?

Thanks

E
GreyHead 04 Mar, 2009
Hi maxelcat,

I don't think so - there may be an option but if so I don't remember it.

You can add your PHP to do server-side validation in the box on the Validation tab if you prefer.

Bob
Max_admin 04 Mar, 2009
Hi, look at components/com_chronocontact/chronocontact.html.php and find:
immediate : true


change it to
immediate : false


Cheers
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
maxelcat 04 Mar, 2009
Hi

thanks for the replies. I have changed immediate : false as suggested.

And its closer to what I want. However, it only shows 1 error at a time, so if the user made 2 mistakes only the first one is shown at the first submit. - is there a way to get all the errors in one go?

thanks again

E
Max_admin 05 Mar, 2009
I don't think this can be done without some hack to the JS code of the validation file!

Cheers
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 05 Mar, 2009
Hi maxelcat,

Try adding stopOnFirst : false to the same options list

Bob
maxelcat 11 Mar, 2009
Hi

Thanks again for the reply

I added stopOnFirst : false as suggested, but it didn't seem to do what I wanted

Here's where I added it :

var valid = new Validation('<?php echo "ChronoContact_".$rows[0]->name; ?>', {immediate : false, stopOnFirst : false,  useTitles : true, onFormValidate : formCallback});


was that correct?

Thanks

E
GreyHead 11 Mar, 2009
Hi Maxelcat,

The next step is for you to get FireFox with the Firebug extension and debug the JavaScript.

Bob
maxelcat 11 Mar, 2009
OK

thanks for your help

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