I have a form where a user rates a poem from 1 to 3. My code is as follows:
<select name="rating">
<cfif len(duplicateCheck.score)><option value="#duplicateCheck.score#">You scored: #duplicateCheck.score#</option>
<cfelse><option value="">– Rate This Poem –</option>
</cfif>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
If the user has already rated the poem, I am trying to make their previous score be selected. If not, the user can select 1-3. How should I do this?
Depends on how you’re storing the fact that the user has already rated the poem. But from a high level:
So, do you already have a handle on whether or not the user has rated the poem? Or is that the actual question?