Title:
Bug 80682:A cfselect element set as required="true" does not provide an alert if there is a default value provided - even when the VALUE attriute is set to value=""
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Gavin Baumanis / Gavin Baumanis (GavinBaumanis)
Created: 11/15/2009
Components: CFForm, Standard XML
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 262088, 262887
Priority/Frequency: Minor / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 2
Problem:
A cfselect element set as required="true" does not provide an alert if there is a default value provided - even when the VALUE attriute is set to value=""
Method:
<!---
This element does not prompt the user to insert a value despite it maked as required='true"
The default option has a blank VALUE and should therefore not be counted as a vaid choice for the form.
i recall their being a "hack" for cfform.js that corrected this behaviour, and I thought it had been subsequently corrected
-Gavin Baumanis.
--->
<cfif isdefined("form.submit")>
<cfdump var="#form#">
</cfif>
<cfset cm = querynew("ContactmodeDesc,contactmodeId")>
<cfset queryaddrow(cm,2)>
<cfset querysetcell(cm,"ContactmodeDesc","desc1",1)>
<cfset querysetcell(cm,"ContactmodeDesc","desc2",2)>
<cfset querysetcell(cm,"contactmodeId","desc1",1)>
<cfset querysetcell(cm,"contactmodeId","desc2",2)>
<cfform>
<cfselect
name="contactmodeId"
query="cm"
display="ContactmodeDesc"
value="contactmodeId"
required="true"
message="Please enter in the Mode of Contact">
<option value="" selected>Please Select</option>
</cfselect>
<cfinput type="submit" name="submit" value="Submit">
</cfform>
Result:
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3040410
External Customer Info:
External Company:
External Customer Name: Gavin Baumanis
External Customer Email: 5D5F35544462E7E699201549
External Test Config: 11/15/2009
Attachments:
Comments: