Welcome Guest, Not a member yet? Register   Sign In
Validation Thread
#5

[eluser]cinewbie81[/eluser]
Ignored my post above, and look at the following code:

I have a select box with following value:
Code:
<select name="gender" id="gender">
<option value="0">Please Select a gender type</option>
<option value="1">Male</option>
<option value="2">Female</option>
</select>

In my controller i want something like this:
Code:
function validation()
{
    // if (selectbox value = 0) prompt error message ("Gender must be either male or female)

    // else if value == 1 (Male) or value == 2 (Female) => Validation PASSED
}
How can i do it ?
what validation rules should i put for gender select box ?? I dont think rules['gender'] = 'required' is the correct one .. anyone ?


Messages In This Thread
Validation Thread - by El Forum - 12-17-2007, 08:18 PM
Validation Thread - by El Forum - 12-17-2007, 08:41 PM
Validation Thread - by El Forum - 12-17-2007, 08:44 PM
Validation Thread - by El Forum - 12-17-2007, 08:46 PM
Validation Thread - by El Forum - 12-17-2007, 09:58 PM
Validation Thread - by El Forum - 12-17-2007, 10:06 PM
Validation Thread - by El Forum - 12-17-2007, 10:33 PM
Validation Thread - by El Forum - 12-18-2007, 08:40 AM
Validation Thread - by El Forum - 12-20-2007, 12:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB