• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validating form data



I have got a couple of issues with my form:

1 ) It won't listen to the maxlength limit I write here, so regardless of how many characters someone enters, it does not complain (they could bufferoverflow my ap)

$this->form_validation->set_rules('areato', 'areato', 'trim|is_numeric|maxlength=[5]|xss_clean');

As you see it should allow a max of 5 characters, but it doesn't care.

2) The second issue is more difficult. In input type field boxes, I have written what the user should enter, (instead of putting a label by or above the field) Usually as you know, as you focus on the field, there is some javascript stuff that automatically deletes the message of say, "enter number". but that input type field is optional, so it can happen that someone just doesnt care about that parameter and leaves the default text message of "enter number".

What happens then? Since in my validation rules I wrote that only numeric characters are allowed, then it will detect the default message "enter number", will notice alfanumeric characters and will give the error.

So, the validation rules should know that it has to ignore that as it is not the user who wrote it, but the default instructions.

Messages In This Thread
Validating form data - by El Forum - 09-23-2012, 05:25 AM
Validating form data - by El Forum - 09-23-2012, 06:38 AM
Validating form data - by El Forum - 09-23-2012, 06:48 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.