After form validation field content turns into Array

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Vinko
New Member
New Member
Posts: 4
Joined: Sun Aug 04, 2013 8:51 pm

After form validation field content turns into Array

Post by Vinko »

cmsms 1.11.7
Formbuilder 0.7.3

When creating a new form and setting the content of a certain field to a variable, like this:
{FormBuilder form='user_details' value_myname='$some_string'}
I get the following warning message after validation:
Warning: strlen() expects parameter 1 to be string, array given in /home/lenter1q/public_html/tiwaz.nl/modules/FormBuilder/classes/TextField.class.php on line 160

The content of the field changes to Array as well.

It looks like the validation adds the current field value to the value_myname and forms an Array. The field is not editable by the user, but the user must be able to see the field value.

Obviously this is not what I want, I want the field to display the $some_string value again. I hope someone can help.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: After form validation field content turns into Array

Post by velden »

Not sure if this will solve the problem, but I would remove the quotes around the variable:

Code: Select all

{FormBuilder form='user_details' value_myname=$some_string}
If quotes are required for some reason I'd use the double quotes:

Code: Select all

{FormBuilder form='user_details' value_myname="$some_string"}
Vinko
New Member
New Member
Posts: 4
Joined: Sun Aug 04, 2013 8:51 pm

Re: After form validation field content turns into Array

Post by Vinko »

Thanks for your reply. Unfortunately it doesn't solve the problem. I'm not sure why I even added quotes here, because I didn't (shouldn't) use them in the code. I removed the option from the form and solved it in an entire other way.
Post Reply

Return to “Modules/Add-Ons”