Welcome Guest, Not a member yet? Register   Sign In
Form Helper & Browser Validation
#1

[eluser]backtoeleven[/eluser]
Hi,

Has anyone managed to use the 'novalidate' option to disable browser validation in conjunction with the form helper?

The specified attributes follow the key => value pattern but the 'novalidate' option doesn't, it's just out there on its own.

So has anyone been able to implement the 'novalidate' option with code such as...

Code:
<?php
$attributes = array('class' => 'email', 'id' => 'myform');
echo form_open('email/send', $attributes);
?>
#2

[eluser]boltsabre[/eluser]
As per w3schools, one of the available syntax options is novalidate="novalidate"
http://w3schools.com/html5/att_form_novalidate.asp

So this should do the trick, test it and see what happens ;-)
Code:
<?php
$attributes = array('class' => 'email', 'id' => 'myform', 'novalidate' => 'novalidate');
echo form_open('email/send', $attributes);
?>

novalidate="" is also a valid syntax option according to the above link, so technically this should also work!
Code:
$attributes = array('class' => 'email', 'id' => 'myform', 'novalidate' => '');

You should note that according to w3schools IE and Safari do NOT recognise this attribute, so you shouldn't code anything that is 100% dependant on this, especially considering the number of iPhone users out there!
#3

[eluser]backtoeleven[/eluser]
Smile Looks like I have misread the w3schools page slightly. I have tried as suggested and it has worked. Thanks for the help.
#4

[eluser]boltsabre[/eluser]
No worries champ, happy to help where I can! Good luck with your project and thanks for taking the time to make this post as answered!




Theme © iAndrew 2016 - Forum software by © MyBB