09 - Create Email Form field to contact Agent
Basicly the email field also display an email with a mailto link but we add a big feature on it, a custom form system :
- Ulimited field adding
- 14 html5 inputs (text, text area selct checkbox, range, file etc)
- multi value systeme
- Upload and attach file to email
- Copy to user and administrator
- Display form in modal regarding view
- Custom submit button
- Recaptcha compatible
- Consent checkbox
In item for user set email and form send value to this email, powerfull and simplier
In this tutorial we will create form to contact Agent and use (later) the relation field to display in estate !
- Create field and set name
- Choose email type
- Assign to agent type
- Go to veiwing tab
- Select form layout
- Display title form yes
- Set your title
- Select if copy email is sended to user
- Select if copy email is sended to administrator
- Set admin email
- Set if input label is diplsay in left (template position heritage) top or in placeholder
- You can set if form is displayed in modal to win some space
- And you can set where did you want to use modal instead of inline form
- Set your text button (you can use JTXT format for translate button
- Set your class button according your template
- And choose size of modal
After this you can customize the form with joomla! repetable field
- Add new field
- Select field type
- Set id name (using in html code)
- Set label of this input
- Select value (regarding type of field)
- Set if this field is required
- With this handle you can change order of display
to use the form system you need to check this
- You need to have 1 email field with emailfrom in id/name AND
- 1 field with name in id/name OR - 1 field with firstname and 1 field with lastname in Id/name
For subject use add subject in id/name of wanted field
To create multivalue field like radio/checkbox/select us your value1;;your value 2 in values. You can use every string and Joomla string translate. Formated values for each field are automaticly created.
You can use any caracteres and JSTRING in value and label
You can use values to add html5 pattern validation for field
- Url 'https://.*'
- Email This email address is being protected from spambots. You need JavaScript enabled to view it.'
- File '.jpg, .pdf .doc or audio/*, image/* and multiple or unique like .pdf;;multiple;;5 for a field with multi pdf with only 5 files or .jpg;;unique for only one jpg'
- Tel '[0-9]{3}-[0-9]{3}-[0-9]{4}'
- Range 'value min;;value max;;step like 0;;100;;10'
For this tutorial we create
After this we can set option for last part of form
- Set text for submit button
- Set class of button according your template
- Display the conset checkbox
- Set texte of consent
- Set link too existing item
- Set if you want to use Captcha, that load captcha plugin set in global configuration of Joomla!
Now you can add an email for agent
and display a form in item view
and a button in category view