Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: Don Jajo - marraskuu 01, 2013, 12:38:36 IP

Otsikko: HTML5 Email Validation for SMF Registration
Kirjoitti: Don Jajo - marraskuu 01, 2013, 12:38:36 IP
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...
Otsikko: Re: HTML5 Email Validation for SMF Registration
Kirjoitti: Arantor - marraskuu 01, 2013, 12:39:16 IP
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.
Otsikko: Re: HTML5 Email Validation for SMF Registration
Kirjoitti: Don Jajo - marraskuu 01, 2013, 01:12:16 IP
But it works fine with mine :)
Otsikko: Re: HTML5 Email Validation for SMF Registration
Kirjoitti: Arantor - marraskuu 01, 2013, 01:13:53 IP
Still not going to get added in SMF 2.x.
Otsikko: Re: HTML5 Email Validation for SMF Registration
Kirjoitti: Don Jajo - marraskuu 01, 2013, 01:16:18 IP
yea, okay :)