Welcome Guest, Not a member yet? Register   Sign In
Am I doing something wrong, or did I find an bug in the validation class?
#1

[eluser]Rob Stefanussen[/eluser]
Hi there, I'm developing an application, and running into a bit of a wall here.

Say you have a form with two fields

first_name which is an input
country which is a radio button with an option of US or UK which defaults to nothing selected.

let's also say the validation rule for both of these contains 'required'

now, submit the form blank.

Code:
$this->validation->error_string
// The first_name field is required
// The country field must have a value <-- notice the different wording

$this->validation->first_name_error
// The first_name field is required

$this->validation->country_error
// '' (empty string)

Why does a notice show up in $error_string, but I don't get a separate one?

Any help would be appreciated
#2

[eluser]maadmac[/eluser]
[quote author="Rob Stefanussen" date="1198217304"]
country which is a radio button with an option of US or UK which defaults to nothing selected.
[/quote]

What's the validation set to? Just "required"? Go ahead and post your code here, it's makes it a bit easier to debug.

Also, I don't know if this is related, but I think a radio button has to be selected, by virtue of being a radio button. That is, I don't think it can default to nothing selected...




Theme © iAndrew 2016 - Forum software by © MyBB