[SOLVED] Formbuilder validation messages language

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: Formbuilder validation messages

Post by irish »

On your PHP page that calls this template, do a print_r on $fb_form_validation_errors. Then submit the form again with errors and print_r will display all the keys and values of the validation_errors.

Code: Select all

print_r($fb_form_validation_errors);
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: Formbuilder validation messages

Post by irish »

Nonus,

You will need to put that in the action.default.php page. around line 52 put this:

Code: Select all

print_r($res[1]);
Of course, you want to do this in your test environment.
irish
Forum Members
Forum Members
Posts: 101
Joined: Tue Jun 03, 2008 2:31 pm

Re: Formbuilder validation messages

Post by irish »

It looks like the array doesn't contain the information you want. It only contains the message. You have two choices now

1) Start hacking the formbuilder module so that it will pass the field labels separately. NOTE: you will need to have a good understanding of PHP to do this.

2) On the action.default.php parse out the field labels in the values of the $res[1] array. e.g. parse "Name" from 'Please enter a value for "Name" '


p.s. are you only doing this so that you can have the error message display in another language? if so, formbuilder comes with many build in languages.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Formbuilder validation messages

Post by Dr.CSS »

How do you mean validate?...

When you make the form you can use 2 one for each language, like this site, test site so you can play, http://www.223isp.net/index.php?page=co ... s&hl=en_US

You have to make sure you generate the forms after adding all the fields...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Formbuilder validation messages language

Post by Dr.CSS »

If you look at the page/tab, when editing the form, that has the form, generate form or some such wording it has all the fields the form will generate...
Post Reply

Return to “Developers Discussion”