Understanding form structure

Basic HTML structure of core form

  • In above code class=”form-widget” is hook of javascript to activate form functions. Form dose not work without “form-widget” class
  • Set receiver’s mail id in hidden field value as display in above code highlighted line no. 3. These settings also possible to set directly in formdata.php file if you do not wish to display email ID in HTML source.
  • data-label=”Name” represent custom labels of value which are use in mail content.
  • data-msg=”Please enter name.” is validation message if field is mandatory .
  • All other attributes are common form field’s attributes.

Validation rules in javascript

  • R.Gen script include common validation rules which are used in all forms of landing pages. You can set your own validation rule according to requirement

Form PHP file settings

  • As explain in above HTML structure section it is also possible to set receiver’s email directly in
    form-data / formdata.php file
  • Above is example code. Set your email ID in place of $_POST[‘to’][‘val’] code.

 

 

Related Articles