[eluser]stormlead[/eluser]
Hi all!
i want to use a form validation in which i just want to check the possible cross site script in the field. for which i am using the function as below
Code:
function username_check($name)
{
if($name=='')
{
$this->form_validation->set_message('username_check', 'The field can not be blank');
return FALSE;
}
elseif ($this->input->xss_clean($name, TRUE) === FALSE)
{
// file failed the XSS test
$this->form_validation->set_message('username_check', 'The field can not be blank');
return FALSE;
}
else
{
return TRUE;
}
}
but the field is getting cleaned and i am getting output as
[removed]alert('in');[removed]
i just want to display a error message and not to process the field any further.
Please help me out to solve this ....