Disabling and selecting first <option> in <perch:input type="select">?

  • Hey there,


    Just wanted to make this little bit of information available on creating a <select> element to everyone and anyone who may need it.

    The documentation is here: https://docs.grabaperch.com/templates/field-types/select/

    If you need, to disable the first option, use an exclamation mark (!) before the option:

    Code
    1. <perch:input id="course_time" type="select" label="Time of course" options="!AM, PM, Full day, Evenings" required>


    If you want to have that option selected, use the value attribute along with the corresponding option value:


    Code
    1. <perch:input id="course_time" type="select" label="Time of course" options="!AM, PM, Full day, Evenings" value="AM" required>


    That is all. :)