In my validation code, I am checking to see if a form entry contains non-numeric characters. I want to use preg_replace if it does and return the form with the corrected field to the user with a warning from form_set_error. However, unlike the issues I found where you want to send the form forward to the submission step, I want to go back to the form, and setting $form_values['submitted'][id] is not sticking. The form field remains unchanged.

What I am trying to do is use a profile field that has a telephone number in it with - dashes and parens in it and I have no way to pre-strip that and populate the webform, so I am trying to do it in the validation code, then check the # digits should be at least 10. If the code had to be stripped and the number was say missing a digit, it should return to the form with the dashes and parens stripped.

Any suggestions as to how to approach this?
--glen

Comments

quicksketch’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

Support is not provided for writing custom PHP code with Webform.