[eluser]Ollie Rattue[/eluser]
[quote author="Codemaster Snake" date="1262211215"]I would really suggest you to use validation on non required fields also. Using CI's native functions will keep your app clean.[/quote]
Yes I would agree that you should use CI validation for all form fields, as it makes the controler code completely clear. If you don't need a field to be required you can in fact set a fieldname without any validation rules, or as I usually do with xss_clean and trim. Example code:
Code:
$this->form_validation->set_rules('location','Location','');
$this->form_validation->set_rules('cinema_name','Cinema Name','required|trim|xss_clean');
$this->form_validation->set_rules('booking_url','Booking url','trim|xss_clean');
$this->form_validation->set_rules('phone_number','Phone number','trim|xss_clean');
$this->form_validation->set_rules('email_address','Email address','trim|xss_clean');