Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

HTML5 Email Validation for SMF Registration

Aloittaja Don Jajo, marraskuu 01, 2013, 12:38:36 IP

« edellinen - seuraava »

Don Jajo

Hello, as we all know the new HTML5 and I came to know it already has email validation built in it. Now I've got to add it into my SMF, just follow these steps to do yours :)

Goto Themes>default>Register.template.php and edit it

Search for:
<input type="text" name="email" id="smf_autov_reserve1" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['email']) ? $context['email'] : '', '" class="input_text" />

And replace with:
<input type="email" name="email" id="smf_autov_reserve1" size="30" tabindex="', $context['tabindex']++, '" value="', isset($context['email']) ? $context['email'] : '', '" class="input_text" />

And we are all done, the submit button won't submit till a valid email is input :)

I just changed <input type="text" to <input type="email" :)

Hope it helps...

Arantor

Except it will cause other issues because SMF is not using HTML5 for the rest of its pages, but XHTML 1.0 which does not support that.
Holder of controversial views, all of which my own.



Arantor

Holder of controversial views, all of which my own.



Advertisement: