Plugin Author
Franky
(@liedekef)
They are shown as normal text fields, but if your browser supports it, validation should happen. Test your browser html5-compat here for the email type:
http://www.w3schools.com/htmL/tryit.asp?filename=tryhtml_input_email
It doesn’t seem to work using the latest Chrome or Firefox browsers.
I’m not great with php but I kind of have an idea of what I want to do. However I’m not sure how to run the code in the booking form, as it only has the attribute tags there – I’m not sure how to modify the form php.
Basically I want to set #_email1 and #_email2 to input type = email (as a first check) and then use code similar to the code below to check that #_email1 matches #_email2.
<input id="email_one" name="email_one" type="email" pattern="^\S{6,}$" onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Must be a valid email address' : ''); if(this.checkValidity()) form.email_two.pattern = this.value;" placeholder="Email" required>
<input id="email_two" name="email_two" type="email" pattern="^\S{6,}$" onchange="this.setCustomValidity(this.validity.patternMismatch ? 'Please enter the same Email Address as above' : '');" placeholder="Verify Email" required>
Plugin Author
Franky
(@liedekef)
I tested using firefox, works fine. See here:
http://www.e-dynamics.be/wordpress/?page_id=495&event_id=4
(try entering an invalid email and press “submit”)
If you want to check that both are equal, you’ll need to use the filter eme_eval_booking_form_post_filter. See http://www.e-dynamics.be/wordpress/?cat=41
The second field will need to be a custom field (currently not possible to use html5-email as a type I think,but that can easily be added). Personally I’m not a big fan of entering your email twice, copy/paste is easy to do and it’s a redundant step I believe.
Extra pattern and javascript options are not possible there, but if you’re good with html, you can always change the form resulting html by using eme_add_booking_form_filter.