Home > eSalesTrack Help Menu > Administrator > Modules > Portal and Web Forms > Hidden Fields
Webforms
Hidden Fields
Hidden fields can be used when creating webfroms. Hidden fields allow you to have fields on your webform that are not seen by when filling out the form on your website. You can have these fields automatically populate information when the information is imported into eSalesTrack. An example of this is automatically populating the lead source field as web or webform so you can remember where the recrods are coming from.
To create a hidden field it is necessary to alter the HTML code of the webform. You will need an HTML editing program and a basic understanding of HTML code.
To Create a hidden field:
1. The first step is to create the webform in your eSalesTrack account, make sure to include the fields you want hidden. After creating the webform copy the HTML code associated with the form. If you are unsure how to create webforms then check out the help article on webforms.
2. Next paste the HTML code into your HTML editing program.
3. Locate the line where the field is that you would like to make hidden, you should see the name of the field in the code. At the very end of the line that has the field you will find the input properties of the field. Here is an example:
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><select name="leadsourcex" id="leadsourcex">
The name of the field is in the middle of the line (Lead Source) surrounded by ">" and "<".
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><select name="leadsourcex" id="leadsourcex">
The name of the field that I will make hidden in this example is called lead source. The part of the code that we will be working with is very last section on the line surrounded by "<" and ">".
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><select name="leadsourcex" id="leadsourcex">
Depending on the field type and field name this section may not look exactly like the line above. Either way you should see the system name of your field after "name=" which in this example is "leadsourcex".
4. The first thing we need to do is make sure the first work is this section says "input". If the field type that you are working with is a text box it should already have input here. In this example this field is a drop down and reads "select". We need to replace "select" with "input".
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><input name="leadsourcex" id="leadsourcex">
5. The next step is to make the field type hidden. To do this all we need to do is add "type=hidden" right after the word "input".
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><input type=hidden name="leadsourcex" id="leadsourcex">
6. The next step is to designate the value that you want to populate in the hidden field. To do this add "value=" after the entry we added in the last step (type=hidden) and also the vlaue you would like to populate in quotes.. In this example we will put the value "Web" in the lead source field. So here we will add "value="Web"".
</select></td></tr><tr><td valign='top' width='25%'>Lead Source</td><td valign='top' width='25%'><input type=hidden value="Web" name="leadsourcex" id="leadsourcex">
7. You also need to delete any lines below that contain the orignal choices for the drop down, if the field type is a drop down. In this example we had drop down that had three values; Web, Phone, and Friend. In the HTML code these lines look like this:
<option value="Web">Web</option>
<option value="Phone">Phone</option>
<option value="Friend">Friend</option>
8. You will want to switch to the design view of your HTML editor program. The field will now hidden. However, you will still see the name of the field on the form. From here you can delete the text that is the name of the field.
9. Then you may want to move the field to the bottom of the form so there is no spacing in between your feilds on the form.
See also
|