DeveloperTutorials for Web Developers & DesignersForms

Calling Custom PHP Functions

The OnSubmitServer Attribute

The onSubmitServer attribute is added to the <ss:forms:form> control, to call a custom PHP function to be run on submission of the form: 


Custom PHP functions are usuallly added via the PHP tab, located in the src view when editing a page. Where the PHP function needs to used accross multiple pages or forms, the function could be added to the website design instead.

Process Form Values with getValues()

The getValues() function can be used to pass form fields to your PHP function. The getValues() function returns an array of all form items, keyed by form item ids or names:


HTML:


PHP:

getValuesForComponent()

As an alternative to the above getValues() function, the getValuesForComponent() function returns an array of all form items, keyed by the datacolumn attribute.