Multiple dynamic dropdown fields
-
Hello!
I have a complicated problem.
I have a from, with 3 dropdown fields. The user has to select something from the first dropdown and the dropdown below will unlock (and so on) and custom options getting filled in via javascript.
I managed to create a custom field, that is displaying all 3 dropdown fields and they are working great. I even get the results send via email.
The problem I have is, that the the fields need to be required. I tried to implement a custom validation. It gets triggered correctly, but I cant invalidate the result.
Even with the following code, the user can still submit the form. It seems the invalidate functionn of the $result class is not working.
Test code:
function custom_dropdown_validation( $result, $tag ) { $result->invalidate( $tag, "This field ins invalid!" ); return $result; }
What do I do wrong? Is there a better solution?
- The topic ‘Multiple dynamic dropdown fields’ is closed to new replies.