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

2 views
Skip to first unread message

J@y

unread,
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

unread,
Jul 13, 2009, 10:26:48 AM7/13/09
to semanti...@googlegroups.com
Hi,

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...

-Yaron
Reply all
Reply to author
Forward
0 new messages