Forums

server side validation

mja1356 06 Apr, 2009
Hi
I have a form that user enter some numerical data in it's fields.
I have a javascript validation and I want to add a server side validation too.
I can get two variable with ($_POST) in (onsubmit after sending email) and compare them.
but how can i prevent to store data in table if condition is false?
where can i put my code onsubmit (after or before sending email).
does before sending email mean before store in database?
chan vay cong so, ao so mi cong so, vay cong so, quan ao, quan ao tre em, quan lot nu, do lot sexy, xe day cho be, do so sinh cho be, ban buon quan ao, do lot[/url]
thanks
mja1356 06 Apr, 2009
sorry
I didn't know that new version of CF has a server side validation box.
but I use old version and have 22 forms.
because I have customers that use these forms daily and i can't backup in old version and restore in new version what can i do?
Max_admin 06 Apr, 2009
well, this is hard, may be you can backup the whole Chronoforms files and tables, take them to your local or test site, upgrade then apply the new changes during the weekend ? new versions are better! get V3.1 if you will do this!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 06 Apr, 2009
Hi mja1356,

Which version are you using? It makes a difference to what you can do.

Bob
mja1356 06 Apr, 2009
Hi
I use ChronoForms V2.5 J1.5 RC3.1 version
Max_admin 07 Apr, 2009

Hi
I use ChronoForms V2.5 J1.5 RC3.1 version



to upgrade from 2.x to 3.x, you need to copy all form code and settings and make it on a v3.x, I think the method I suggested before is gonna be the best here!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
mja1356 07 Apr, 2009
Hi
I think I have to do that.but is there any solution to validate two fields in form and if one greater than another form not submitted.(data doesn't save in database) and create an error message?
I can access text input fields in onsubmit code via $_POST and create error but I don't know how to prevent sending data to database.
thanks again
GreyHead 07 Apr, 2009
Hi mja1356,

You can do this either with JavaScript validation - adding a custom validator to the existing validation code would be a good way; or you can use servers ide validation using the box on the Validation tab. Either of these will stop any further processing until the validation condition is met.

Bob
mja1356 07 Apr, 2009
Hi
I'm using j.s validation but I want php validation for some users that disable j.s.
I have two input text box.i want to compare them.if one greater than another form doesn't submitted.
I don't know how can i do this in validation tab.
I use old version of CF and until I have time to upgrade my CF i want validate my form.
thanks
GreyHead 07 Apr, 2009
HI mja1356,

Time to upgrade! There are many improvements in the current versions.

You'll need to add the PHP to check in the OnSubmit before box and then set showform($_POST); if there is an error.

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