Published — v. 5
HTML Tips for Form Creation
When you are creating or editing a Profile Update Form, this quick HTML reference may help you alter the form to meet your needs. For additional instructions on how to use HTML code, see a Web site such as http://www.w3schools.com/html/
Form element | Example | HTML code | Result |
Input text field | <input name="campo5" type="text" maxlength="100" /> | The text entered by the user will be saved in the recipient field that has ID campo5 | |
Checkbox | <input type="checkbox" name="campo2" value="Action" /> Action <input type="checkbox" name="campo2" value="Adventure" /> Adventure | The value associated with the checkbox selected by the user will be saved in the recipient field that has ID campo2. In this case, if the user selects both of them, the value saved will be "Action, Adventure" | |
Radio button | <input name="campo7" type="radio" value="M" /> Male <input name="campo7" type="radio" value="F" /> Female | The value associated with the radio button selected by the user will be saved in the recipient field that has ID campo7. In this case, if the user selects "Male", the value saved will be "M" | |
Dropdown | <select name="campo9" id="campo9"> <option value="rrrr">rosa</option> <option value="gggg">giallo</option> </select> | The value associated with the drop-down menu item selected by the user will be saved in the recipient field that has ID campo9. In this case, if the user selects "rosa", the value saved will be "rrrr" | |
List | <select name="campo8" size="4"> <option value="bbbb">bianco</option> <option value="vvvv">viola</option> <option value="libero">grigio</option> </select> | The value associated with the list item selected by the user will be saved in the recipient field that has ID campo8. In this case, if the user selects "bianco", the value saved will be "bbbb" | |
Multiple selection list | <select name="campo5" size="4" multiple="multiple"> <option value="bbbb">bianco</option> <option value="vvvv" selected="selected">viola</option> <option value="liber">grigio</option> </select> | The value associated with the list items selected by the user will be saved in the recipient field that has ID campo5. In this case, if the user selects "bianco" and "viola", the values saved will be "bbbb,vvvv" | |
Groups | name=group | You can use check boxes, radio buttons, lists, etc. For example, with checkboxes, you would have: | The user will be assigned to the groups selected on the form. |
Please note:
- Use the Codes Table to look up the Group IDs (they are always integers).
- To set whether a field should be required, configure that property in your Recipient fields
- Each recipient field can accept up to 100 characters. You can use the maxlenght attribute of an input field to limit the input to 100 characters. For more information on this, see for example: http://www.w3schools.com/tags/att_input_maxlength.asp
- You can submit a value invisibly when then form is submitted by setting a field as hidden (type="hidden")
- You can pre-fill a field with the value that currently exists in the database by using dynamic fields. For example, value="[name]" to pre-fill the first name text input field with the recipient's name
- The form must always include a hidden or visible field with name="email" and value="[email]". Otherwise an error message will be shown when the form is submitted.
- Remember that Recipient fields are shared across all Lists in the same account.
- Anybody that fills out a Profile update form is automatically assigned to a new group that is created with the name of the form. To prevent this from happening, remove the following line of code from the HTML that is created by default by the system when you add a new form:
<input type="hidden" id="apgroup" name="apgroup" value="ID of the new group added automatically">