To validate the form I'm using jquery simple validation. In order to validate a section I put the "class="required" around it but for the select fields I was wondering if it would be possible to display a pop up if they aren't selected?

The code:

<select name="sltDay">
                        	<option value="">day</option>
                           	<% 	For i = 1 to 31
									Response.Write("<option ")
									If intDay = i Then 
										Response.Write(" selected ")
									end if 
									Response.write ("value=")
									If (i > 0 and i < 10) Then 
										Response.write(i & ">" & "0" & i & "</option>" )
									Else
										Response.Write( i & ">" & i & "</option>" )
									End If
								Next %>
                      	</select>
                        <select name="sltMonth">
                        	<option value="">month</option>
                          	<% 	For i = 1 to 12
									Response.Write("<option ")
									If intMonth = i Then 
										Response.Write(" selected ")
									end if 
									Response.write ("value=")
									If (i > 0 and i < 10) Then 
										Response.write(i & ">" & "0" & i & "</option>" )
									Else
										Response.Write( i & ">" & i & "</option>" )
									End If
								Next %>
                       	</select>

Any help would be great

Member Avatar for stbuchok

Create an option with a value of 0 that indicates nothing is selected. Then if, when you submit, the selected index is 0, throw a validation message. Well, at least that's what I would do.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.