0

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

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by stbuchok
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.