Documentation / Tutorials / Awesome Services
AW Form Service
/ Awesome Services / AW Form Service
AW Form service usage note:
In this module all forms fileds are declared.
To add new form add the config subarray inside the form_topics array
Form config array contains:
- This service is use to handle the form data after submit
- More details explained bellow
- This service is optional, it used for do the specific activities after the form submission
- Also you can pass the form specific parameters using atts eg. admin mail etc.
- In this field mention the all form groups with label as the group label
- In the group declare all the form fields this fields will come from the form_control2 service
- Mention the service slug which will handle the form submission
- In this service do the server side validation and return the array if any error occured.
- To make server side validation works return the validation array with key as validations in which subarray contains key as meta_key and reason as error msg.
- You can use any content type service or collection service to handle the form submission eg: candidate, admission, lead
- This module is used to generate the redis ticket which is used in form handling.
- To generate the ticket use this:
- This module receives the ajax request from form submit handler
- The all request params array is then set in the single_data env variable
- The form_config of that form type is also set in the single_data variable
- The form name is also set in the single_data varable
- Then update service is fired which is mentioned in the single_data’s form_config variable
- Then update service Fired
- It also populates the first error form control field.
- If any callback service is mentioned in the form_config then that service fired after the execution of the update service.
- If every thing is fine then final success msg is returned.
- This module contents all the validation templates.
- Depends on the data_type of the filed, particular form validation ran.
- If the validation get failed then error msg returned with the validation error and field key.
- All the form fields which are mentioned in the form config gets the html from the form control2 service
Call this module with the slug parameter of form which needs to be created.
To change the layout of the form fields just change the form_layout parameter.