Demanding of the drop-down list in CFMX form fields

Required form fields in Coldfusion MX 6 help with HTML forms for that I use the following method:

-a hidden field that has a name attribute composed of the name of the field and the suffix '_required '.

You can use this technique with CFML and HTML tags form. If the user leaves the FirstName field empty, ColdFusion rejects the submission of form and returns a message informing the user that the field is required. You can customize the contents of this error message.

For example:
To require that the user enters a value in the field FirstName for a HTML input tag, I use the following syntax:

< input type = "Text" name = "FirstName" size = "20" maxlength = "35" >
< input type = "hidden" name = "FirstName_required".
value = "You must enter your first name." >

This is a nice, simple, solution non-javascript. However, it seems to only work for text fields and entered radio, not the drop-down lists. Is there a way to the same demand of the drop-down lists in the form? (I prefer not to have to resort to additional javascript validation)

I used it with some fields.


The issue here is that if you have any tag "selected" option
even an empty option "Select a value" type, this selection has been
finished and he will not raise a validation error.

Tags: ColdFusion

Similar Questions

Maybe you are looking for

  • Replacement screen for B460

    Hello I own a laptop Lenovo B460 (model No. 24007). I am looking for a replacement of the screen for the same. The specifications are: 14 '' HD LED Glare Also, after some research it seems to be a widescreen (16:9 aspect ratio) and 1366 x 768 pixels

  • Example: Pavilion g6: usb taken don't work that usb2 and usb3

    Received this laptop a year or two ago, came with w8 yuck!, went on this site and a nice hp technician gave me all the links for the drivers for w7, as hp list only w8 drivers for this laptop! laptop has worked well, got a 1 TB external hd recintly a

  • Drive F

    Two weeks ago my machine, startup gives me a blue screen running disk f.  Although he says he made 1 of 3 controls, he never passed this point or 79% of the operation.  He teaches me that a sector is not readable.  How can I fix it?

  • failed to update Windows 7

    I installed windows 7 64 bit and have not been kept up-to-date, There is no error code, but it hangs just, nothing to do. the CPU usage is very high and computer is slow when the update is active, the only way to use the laptop is to disable the Task

  • Windows networking problem, validation of server certificates

    Hello everyone, My school has a WiFi network that uses WPA-Enterprise Security and AES encryption; However, for some reason, in the settings PEAP, the box "Validate server certificate" must be unchecked (I have Windows 7). I also uncheck the box 'ena