Hi everyone, I created a webform using multiple fieldset to submit a 'request info' and I want users to accept web site Terms and Conditions before submitting the form. Now I want a validation string that block submissions of non accepted forms. I tried different suggestions found here but I'm not a programmer so I've found quite difficoult to write the right code. I would like also to check and validate the phone fields for numbers only input.

Thank you

Comments

quicksketch’s picture

Try modifying the suggestions from the Webform handbook page: http://drupal.org/handbook/modules/webform. There's a few examples listed at the bottom of the page.

lupinix’s picture

Thank you, I tried to do that but the form give me the error even if I put correct values. I took the http://drupal.org/node/236970 example code and modified as follows. It doesn't work sending the form anyway and giving me this error

Parse error: syntax error, unexpected T_IS_NOT_EQUAL in /home/dgpace/public_html/test/sites/all/modules/webform/webform.module(1403) : eval()'d code on line 2

Please help me, I just want that if people select the YES radio button the form will be sent and warn the user if it is NO the answare.

if ($form_values['submitted_tree']['full']) != "Si") {
  form_set_error('submitted][full', t('You must say yes.'));
}
quicksketch’s picture

You've got an extra closing parenthesis in there:

if ($form_values['submitted_tree']['full'] != "Si") {
  form_set_error('submitted][full', t('You must say yes.'));
}
lupinix’s picture

Oh! sorry, I did erease the parenthesis and the error disappeared but it gave me the warning even if I check 'Si'...

quicksketch’s picture

Status: Active » Closed (fixed)

I'm not able to provide further help on this issue and it has been several months since a post. Closing to clean the queue.