[eluser]mradlmaier[/eluser]
Hi,
I am posting this here because I am not sure if this is a bug or if I am missing something.
I tried and modified the example in the userguide:
Quote:myform.php
Code:
<html>
<head>
<title>My Form</title>
</head>
<body>
<?php echo validation_errors(); ?>
<?php echo form_open('form'); ?>
<h5>Benutzername</h5>
<input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" />
<h5>Passwort</h5>
<input type="password" name="Passwort" value="<?php echo set_value('Passwort'); ?>" size="50" />
<h5>Wiederholung</h5>
<input type="password" name="passconf" value="<?php echo set_value('passconf'); ?>" size="50" />
<h5>Email Addresse</h5>
<input type="text" name="email" value="<?php echo set_value('email'); ?>" size="50" />
<div><input type="submit" value="Registrierung" /></div>
</form>
</body>
</html>
As you can see I change the name of the first password field to 'Passwort' (That`s german.)
form.php
Code:
<?php
class Form extends Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Benutzername', 'required|min_length[4]|max_length[12]');
$this->form_validation->set_rules('Passwort', 'Passwort', 'required|min_length[4]|max_length[12]');
$this->form_validation->set_rules('passconf', 'Passwort Bestägung', 'required|matches[password]');
$this->form_validation->set_rules('email', 'Email Addresse', 'required|valid_email');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}
}
?>
I guess the expected behaviour for failing the 'matches' rule would be to display:
The Passwort Bestägung field does not match the Passwort field.
But it displays:
The Passwort Bestägung field does not match the password field.
Is this a bug or do I miss something here?
On another note, the ideal behaviour should be to display the "human" name of the field to match, wouldn`t it?
Michael