I am using codeigniter to make a login form using php. A screenshot demonstration
I would like to use the traditional html5 required tag for input fields. The html5 required tag doesnt allow you to submit a page if the input field is empty and it has a good style as it popsup without reloading the page.
I am using codeigniter and even though I've added the required functionality to the input form, it still allows users to submit pages on empty fields, and it gives them the error after the page reloads. and the style is ugly.
How do i make the php codeigniter required tag like the html5 inbuilt required tag
My Php codeigniter code
$this->form_validation->set_rules('username', 'username', 'required');
I would like to make it similar to the html required field style
Username: < input type="text" name="usrname" required >
Thanks in advance