Forum

Thread tagged as: Problem, Forms

"perch:label" is showing in output HTML

I have a form set up and it's working properly except that the perch:label is showing in the HTML that is sent to the browser. For example, the perch form has at the following input and label:

<div class="input"> <perch:label for="form1_fname">First Name</label> <perch:input type="text" name="fname" id="fname" size="" label="First Name" /> <perch:error for="fname" type="required">Please add your first name</perch:error> </div>

When the form is rendered by a browser the source shows:

<div class="input"> <perch:label for="form1_fname">First Name</label> <input id="form1_fname" name="fname" type="text" /> </div>

I would have thought that "perch:label" would have been changed into just a "label".

I was also surprised to see that Perch is changing the ID's that were added to the form template to include "form1_", which threw off the css that had initially been created.

Timothy Swan

Timothy Swan 0 points

  • 6 years ago

<perch:label for="name">Name</perch:label> is as per the example code.
Your label closing tag is </label> not </perch:label> may be the problem.

Pete

Thanks. Sometimes you stare at something for so long...