Forum

Thread tagged as: Question, Problem, Forms

Perch Forms : Select - Default item

I have a Perch Form which I want "Please Select" to show as default in the dropdown. I have the same code working on many sites but on my latest it seems to be adding a blank option first. Is this my error or a bug. I am using latest Perch and Forms App.

<div class="form-group">
  <perch:label for="referral">How did you hear about us?:</perch:label>
  <perch:input class="form-control" type="select" id="referral" label="How did you hear about us?" 
      options="
      Please Select|Please Select,
      Search Engine|Search Engine,
      Advertisement|Advertisement,
      Recommendation|Recommendation,
      Event|Event,
      Other|Other" />
</div>
James Tedder

James Tedder 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Does removing the blank line at the start of the attribute value have any impact?

Just tried and no difference.

<div class="form-group">
  <perch:label for="referral">How did you hear about us?:</perch:label>
  <perch:input class="form-control" type="select" id="referral" label="How did you hear about us?" 
      options="Please Select|Please Select,Search Engine|Search Engine,Advertisement|Advertisement,Recommendation|Recommendation,Event|Event,Other|Other" />
</div>

Just tried this also:

<div class="form-group">
  <perch:label for="referral">How did you hear about us?:</perch:label>
  <perch:input class="form-control" type="select" id="referral" label="How did you hear about us?" 
      options="Please Select,Search Engine,Advertisement,Recommendation,Event,Other" />
</div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

How about:

<perch:input class="form-control" type="select" id="referral" label="How did you hear about us?" 
      options="Search Engine,Advertisement,Recommendation,Event,Other" allowempty="true" placeholder="Please Select" />

That worked a treat - Thanks :-)