Form Validation Part II - JS and the Constraint Validation API

Поділитися
Вставка
  • Опубліковано 23 гру 2024

КОМЕНТАРІ • 19

  • @diggerdog001
    @diggerdog001 Рік тому +2

    When i first time find out about constraint validation API i can't find high quality videos about this. Thanks god i found your video Professor

  • @ThEldeRS
    @ThEldeRS 3 роки тому +1

    First time that I ever see or hear about the validity API! Illuminating and instructive as always! Thank you for your videos and explanations!

  • @frankgregory6845
    @frankgregory6845 3 роки тому +1

    This is awesome! I've been using JS to validate code but had no idea these validate properties existed. To be able to generate a custom code that the browser delivers is great. Thanks for the lesson. I've learned a lot from your tutorials! Please keep going!

  • @youmnaification
    @youmnaification 3 роки тому

    Thanks for all your thorough tutorials. I subscribed to your channel years ago and now coming back to it to solidify my JS skills.

  • @latabernadelcarpincho
    @latabernadelcarpincho 7 місяців тому

    Great video! it helped me to get an idea of how to apply this API in my practice project

  • @wlindstrom
    @wlindstrom 2 роки тому

    Very informative thanks my guy. I really appreciate the methodical and wide-angle approach.

  • @KnightToD5
    @KnightToD5 10 місяців тому

    Your content is excellent. You are my go-to resource.

  • @soldadopreciso
    @soldadopreciso 3 роки тому +1

    hello pal, tell us about why you use that APP Object ?, interesting approach.

  • @haldx
    @haldx 3 роки тому

    Maybe you could use the novalidate attr temporarily while testing backend validation code.

  • @Sindoku
    @Sindoku 3 роки тому

    I thought you was gonna say “anything that can go wrong, will go wrong” lol

  • @yeahcharles7870
    @yeahcharles7870 3 роки тому

    Thanks for this video. A question regarding the final steps in the email validation example. You demonstrated how to update the span element that has the class .errMessage in the "fail" function. But how do we remove the span content if the user corrects the mistake and no longer needs to see the "Must be a valid Gmail address" text in the errMessage?
    I tried extending your testEmail function but I'm not having much luck:
    testEmail(ev) {
    let email = ev.target;
    //console.log(email.validity);
    email.setCustomValidity(''); //clear old message
    //built-in test for error based on type, pattern, and other attrs
    let currently = email.checkValidity();
    //console.log('currently', currently);
    if (currently) {
    let emReg = new RegExp('@gmail.com$', 'i');
    if (emReg.test(email.value) === false) {
    //not a gmail address
    console.log('NOT a gmail address');
    email.setCustomValidity('NOT a gmail address.');
    console.log(email.validity);
    email.reportValidity(); //show the custom message, trigger invalid event
    } else {
    // clear the content of the errMessage span
    let span = email.parentElement.querySelector(".errMessage");
    span.textContent = "";
    };
    }
    },

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому

      We always want to clear out the old message at the start of the validation process.
      Put your two lines of code right after
      email.setCustomValidity('');

  • @stalan7404
    @stalan7404 2 роки тому

    20:54 "I dont want that appear anymore"
    isn't it the opposite?
    `email.setCustomValidity("");` means that turn `currently` true and check validity every change?

  • @topspeedbrazil6853
    @topspeedbrazil6853 3 роки тому +1

    Hello my beautiful friend 🍃♥️🇧🇷

  • @qzbnyv
    @qzbnyv 3 роки тому

    Could be my wild imagination, but you’ve sounded a little out of breath the last video or so. And I know things aren’t the best in North America atm. So I hope you’re doing well Steve and are safe and healthy.

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  3 роки тому +2

      Thanks for your concern. My family and I are all doing well. I've got a cold (not covid) and am a bit congested that's all.

  • @nuru484
    @nuru484 11 місяців тому

    Too much unnecessary talk, why not go straight to the pooint? Mtcheew