В форме есть переключатели для выбора пользователем:
<li>
<label for="full professor"><span class="required">&##8727;</span>Is the candidate a full professor?</label>
<input type="radio" name="fullProfessor" value="yes" tabindex="4" />Yes<input type="radio" name="fullProfessor" value="no" tabindex="5" checked/>No </li>
<li>
<label for="more than ten"><span class="required">&##8727;</span>Has the candidate been here for more than 10 years?</label>
<input type="radio" name="moreThanTen" value="yes" tabindex="6" />Yes<input type="radio" name="moreThanTen" value="no" tabindex="7" checked/>No </li>
<li>
<label for="past nominee"><span class="required">&##8727;</span>Has the candidate been nominated for this award in the last 3 years?</label>
<input type="radio" name="pastNominee" value="yes" tabindex="8" />Yes<input type="radio" name="pastNominee" value="no" tabindex="9" checked/>No </li>
Я не уверен, как их выставить. Типичный код, который я использую:
<cfparam
name="FORM.fullProfessor"
type="string"
default=""
/>
Является ли строка типа, даже если она не принимает строку как текстовое поле?
Для подтверждения переключателя используется:
<!--- Validate campus address. --->
<cfif NOT Len( FORM.fullProfessor)>
<cfset ArrayAppend(
arrErrors,
"Error message here."
) />
</cfif>
Наконец, поддерживая выбор пользователей после проверки страницы, как я могу обеспечить это?
<cfif isDefined(form.fullProfessor) selected="yes">?
Спасибо.