If you send your forms in an email or use guest mode, you may want to hide or restrict guests from editing certain fields when they fill out the form.

To hide a section of the form:

In the <div> element, add "hidefields" as the value to your class attribute.

Example:

To hide the first name text box (name="Fname", id="Fname") from your guest, in the <div> element of the text box, add class="hidefields".

<div class="hidefields">
<input type="text" class="form-control" name="FName" id="FName" />
</div>

To make a field mandatory in HTML:

If you wish to make a textarea, textbox, or any other field a mandatory field, add required and label attributes. The required attribute will make the field mandatory and the label attribute will be used to inform the user that the field is not filled, in the form of an error message.

Example

<textarea onfocusin = " textAreaAdjust ( this ) " onkeyup = " textAreaAdjust ( this ) "
class = " form-control " rows = " 5 " id = " notes "
name = " Notes " placeholder = " Enter your areas of concern "
label = " Areas of Concern " required ></textarea>

To hide fields that are mandatory for your provider but hidden for your guest:

If you want to hide fields that are mandatory for your provider, but not your guest, when the form is sent in an email or viewed in guest mode, then:

Add viewtype="hidefields" attribute to your element.

Example:

To hide the first name box (name="Fname", id="Fname") when opened from an email link, the Webstore profile, or CMA, in the input element, add viewtype="hidefields". This will hide the element from being viewed by the guest when the form is opened ing guest mode.

<div>
<input type="text" class="form-control" name="FName" id="FName" required
viewtype="hidefields" />
</div>


Learn more about building an HTML form

Did this answer your question?