Anyone know where to place validation code when a semantic form is filled and submitted?

Skip to first unread message


Jul 11, 2009, 7:10:34 PM7/11/09
to Semantic Forms
I want to validate an entry when a user enters data into a form. SFs
already check things like dates so surely it must be possible to add
your own data validation routine?

Any ideas?

Yaron Koren

Jul 13, 2009, 10:26:48 AM7/13/09

I think the best way to do this is to create a new extension, that defines its own input type, which also adds on to the $sfgJSValidationCalls global variable. See the Semantic Google Maps code for how an extension can define a new SF input type. Instead of calling validate_field_type(), though, the new validation call should call some custom Javascript function that you create - you should add it to the $javascript_text returned by the input type. That way, you shouldn't even need to modify Semantic Forms at all. I hope that all made sense...

Reply all
Reply to author
0 new messages