• Resolved barbarza

    (@barbarza)


    Thanks for this plugin. It took some getting used to but I am pleasantly surprised at how powerful it is. Definitely a hidden gem!

    I was just wondering, I can’t seem to get the #_HTML5_EMAIL and #_HTML5_PHONE fields to work in the form. They display as normal text fields – they don’t do any validation.

    Also, would it be possible to have two email fields so they have to enter their email address twice, and then it checks that the entered email address is the same?

    Many thanks, keep up the amazing work!

    https://ww.wp.xz.cn/plugins/events-made-easy/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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

    Thread Starter barbarza

    (@barbarza)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘#_HTML5 fields not validation’ is closed to new replies.