5: How to validate a form using AJAX - Learn AJAX programming

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

КОМЕНТАРІ • 276

  • @MuhammadQasim-cc7pz
    @MuhammadQasim-cc7pz 5 років тому +1

    Thank you so very much, I was using another website to learn ajax, php etc and I had practically given up cuz I could really not understand what was going on. That's when I accepted a project I didn't have the knowledge for and that led me to your channel...never knew I could learn php and ajax from scratch and also complete a website within the deadline, your teaching made it possible.

  • @adamhardy6765
    @adamhardy6765 7 років тому +15

    Wonderful video. thanks so much for this. I find my website evolving with every video you post.

  • @manaspasrija5673
    @manaspasrija5673 7 років тому +3

    12:18 and 29:40 information is very important for my project..... thx buddy

  • @DereckNoom
    @DereckNoom 6 років тому +2

    Thank you for this great tutorial! Also love the channel!
    FYI: When the email gets send succesfully, the comment below is still the same warning as when all fields are empty. It should probably say something like: Email send succedfully..

    • @pravinram7896
      @pravinram7896 4 роки тому

      same problem for me too.. did you find a way to print "email send successfully"??!!!

    • @DereckNoom
      @DereckNoom 4 роки тому

      @@pravinram7896 Sorry, I haven't or just can't remember. Also I'm not using jQuery anymore...

    • @pravinram7896
      @pravinram7896 4 роки тому +1

      @@DereckNoom it's ok bro... thank you for texting back! have a good day

  • @stefanocarpi4034
    @stefanocarpi4034 6 років тому

    I'm Italian and I know English not too well and I was looking for a solution for a project I'm carrying out. Congratulations, you're great

  • @comrade_matthew
    @comrade_matthew 5 років тому +1

    My CV looks good cause of your tutorials... thanx alot.

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

    Your lessons are truly the easiest to follow, in fact though I am yet to upload a website online, I had first come to understand and appreciate the fundamentals of php and web programming though your tutorials. Im currently working with XAMMP, developing a school web site that students can easily log into see their results. Been working on it since June 2020, and I must say for me, a person with zero experience in programming and not completing my university studies, your tutorials have given me confidence in myself in terms of my ability to learn newer and more difficult subjects. I hope to build my own social media application one day...Thank you Danny!......

  • @sumantapader9725
    @sumantapader9725 5 років тому

    You explain with so much care!!!!.....love it....

  • @kingsleyromi7291
    @kingsleyromi7291 5 років тому

    I love this guy's teaching. Cool tutorials and explanations! Thumbs up man!

  • @jaabrty
    @jaabrty 7 років тому

    Couldn't believe it. I asked for this lesson last episode. Thanks a lot!!

  • @robinjoseph1678
    @robinjoseph1678 7 років тому +4

    Great bro! u just got me a step higher in programming experience!

  • @namannbansal
    @namannbansal 4 роки тому

    Hey what an amazing explanation. I went through the documentation once before watching this and tbh I understood every single word you said. Hats off to you man, really amazing.

  • @ocanodiego
    @ocanodiego 7 років тому +28

    CTRL + Shift + D duplicates the line in sublime :)

    • @Dani_Krossing
      @Dani_Krossing  7 років тому +10

      Thanks I'll use that shortcut in the future :)

    • @jaabrty
      @jaabrty 7 років тому

      mmtuts yes it works with all editors. I think it works also to duplicates pix inside word file.

  • @xiehper4586
    @xiehper4586 4 роки тому

    as usual, your tutorial was so elaborate, you leave no room for confusions. i was honestly wondering if the form is necessary. thank you !

  • @TheLeontheking
    @TheLeontheking 6 років тому +2

    i really have to complain..
    after watching your web dev videos it now became nearly impossible to watch the ones of others ;) really good content, and you always focus on the most essential aspects! Keep up!

  • @RaulGomes91
    @RaulGomes91 5 років тому +3

    CSS file:
    drive.google.com/file/d/1Xnrgi88S9CWaq5J7JTfuJ1pmy2Ro94UY/view?usp=sharing
    you can see it at 19:48, so I transcribed it.

  • @jahoopyjaheepu497
    @jahoopyjaheepu497 6 років тому +2

    This is great, I've been using it for a lot of different forms on my site, adding my own functionality. My only question is what should we do if we want to use the header(Location:) function upon successful submission, as with this setup it loads the new page into the form message div?

  • @boraabee
    @boraabee 4 роки тому

    I usally don't comment videos, but Sir you helped me a lot !! Thank you so much!

  • @erikasong3054
    @erikasong3054 7 років тому

    yay thank you! I have watched this tutorial from the very first start and you are so amazing! Thanks! Merry Christmas! God bless you!

  • @pepeback
    @pepeback 7 років тому

    Thanks for your tutorial. Just one small detail. No need to define any method in when using Ajax. Because e.preventDefalult, prevents anything you define in the form. The "load" method in jQuery uses POST by default when sending a data object.

    • @Dani_Krossing
      @Dani_Krossing  7 років тому

      Jose Correct :) I explained that at the end og the episode.

    • @pepeback
      @pepeback 7 років тому

      Yes, I wrote the comment before finishing the video Too fast ;)

  • @elinjoroge4266
    @elinjoroge4266 7 років тому

    that was easy to understand . the video is wonderful. Asante sana

  • @dexterpascua4782
    @dexterpascua4782 4 роки тому +1

    Thanks! Keep making videos. I suggest a video tutorial for game programming for web. :)

  • @surinfarmwest6645
    @surinfarmwest6645 7 років тому

    Daniel, once again, thank you very much. I built a similar form yesterday (BOOTSTRAP) using php and html. I can see the advantages of this method so will use this lesson to redo the form. Picked up some good points on styling as well. Thank you :-)

  • @happychords86
    @happychords86 5 років тому

    Your tutorial is very practical. I like it! Thank you!

  • @sonamohialdin3376
    @sonamohialdin3376 Рік тому

    This tutorial is very helpful thank you

  • @carlossandoval7439
    @carlossandoval7439 7 років тому

    Very well done, thank you for your contribution to the community. Now that you've started this ajax series, Please consider to do a tutorial for a chat (for customer support or a social chat for your website)

  • @osraneslipy
    @osraneslipy 4 роки тому

    Dude lov your lessons, they are the freakin best!!

  • @vicliur2
    @vicliur2 7 років тому

    THANK YOU! You saved my life !

  • @nooraldeenali4628
    @nooraldeenali4628 4 роки тому

    It is really awesome . Thanks man.

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

    Thaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaank you so much for this incredible tutorial. YOU HAVE SAVE MY LIFE.

  • @bartoszjaniuk7681
    @bartoszjaniuk7681 5 років тому +8

    Download link is down :/

  • @AnshuAditya111293
    @AnshuAditya111293 7 років тому

    mmtuts, your videos r always amazing.

  • @lakshanchamod1208
    @lakshanchamod1208 3 місяці тому

    clearly understood 💕💕❤❤

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

    Great videos , thanks alot :)

  • @Mr_Simmons
    @Mr_Simmons 6 років тому +1

    Congrats on 100K subs by the way! You mention in this lesson that we can download the styles sheet in the description, but the link doesn't work anymore. Just letting you know so you can update it later. I've been going through a lot of your videos recently and they are really good. I still have a lot more to get through though. Keep up the good work! because these is some top notch coding lessons!

  • @AIstoriesHQ
    @AIstoriesHQ 4 роки тому

    That was a beautiful tutorial, thank you!

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

    These videos are absolute gem, but once again, the style is not on the description anymore, would be amazing if you could upload them again

  • @arturfornagieri7117
    @arturfornagieri7117 6 років тому

    this videos always helping me

  • @DheerajKumar-kx4jz
    @DheerajKumar-kx4jz 5 років тому +2

    This tutorial is very helpful. But how to download this code. Given link showing error

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

    Please give a tutorial on how to validate a multistep registration form in Javascript

  • @hamahawlery7194
    @hamahawlery7194 4 роки тому

    You are the best of best

  • @arturkarapetyan9455
    @arturkarapetyan9455 4 роки тому

    Thanks bro. really helpful.

  • @fares.abuali
    @fares.abuali 3 роки тому

    Thanks! Keep it up

  • @tohodakilla
    @tohodakilla 6 років тому

    16:01 php tag is for server, not browser, awesome video thanks.

  • @LucreciaFraile
    @LucreciaFraile 7 років тому

    the video is really good, very well explained!! congrats. The only thing is that you din't tell how to send the email (php code), and I will really like to know how to do it with Ajax. I don't know if you have a video explaining this. Thank U!

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

    thank you very much man❤

  • @kenntheentrepreneur4027
    @kenntheentrepreneur4027 5 років тому +3

    Thank you soo much, but how can you disable the preventDefault() so you submit the form when there are no more errors?

    • @YassineChannel01
      @YassineChannel01 4 роки тому

      You won't need it at all ! you can insert data in database through the PHP page that you put inside the function (#.form-message").load("pagePHP.php")...

  • @dipanjanmukherjee6223
    @dipanjanmukherjee6223 7 років тому

    thank you so much for this series...as always , your videos are the best...One more request . What would be the approach and some useful functions when trying to Refreshing comments and likes with ajax jquery automatically (e.g. every 10 secs)

  • @hamahawlery7194
    @hamahawlery7194 4 роки тому

    You are my teacher!

  • @pereksuub9
    @pereksuub9 6 років тому +1

    Please create a video on how to insert data to mysql with ajax, php at jquery

  • @happypurple3220
    @happypurple3220 4 роки тому

    So this is the last eposide for AJAX bro? oh... I want to learn more about AJAX... thanks for your Good Lesson.

  • @lukahkamande6826
    @lukahkamande6826 6 років тому

    Nice one.Congratulation man!

  • @laCreativeRoom
    @laCreativeRoom 4 роки тому +1

    Thank you for this tutorial, but the Error Message is not shown below the form, but on another page... How can I fix it? Thank you in advance.

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

    Thank you so much 😌

  • @tunisiasparx2105
    @tunisiasparx2105 5 років тому

    thx a lot for this quality of videos , i mean the quality of informations you give ! it helps a lot a lot in terms on understanding how things work ! we learn a lot fo stuff in short time , and it also makes things clearer
    keep on with this kind of tutorial we really need someone like you ;)

  • @Ramaihaholic
    @Ramaihaholic 4 роки тому

    hi, could you make a video about "how to filter input from a commenting system using ajax (to secure your html by converting < and > into < and >)

  • @islamtouahri5802
    @islamtouahri5802 7 років тому

    cool video it helps me so much with ajax

  • @Daniel-sk2tq
    @Daniel-sk2tq 3 роки тому

    hello wonderful short series of tutorial man :) i love it, but you said you were gonna do also AJAX using JavaScript but I can not find it :(

  • @spiroguberina7324
    @spiroguberina7324 7 років тому

    Thank you for your tutorials, I'm learning a lot watching your lessons!
    Is it possible for you to make a CRUD tutorial, or to post some examples??

  • @kiabayat5441
    @kiabayat5441 5 років тому

    welldone my friend keep going , nice one

  • @litosax
    @litosax 5 років тому

    Great explanation! As always...
    I'm wondering if you have same information about how to protect this kind of forms agaist CSRF attack.
    Do you have some episode about this issue?
    Thank you!!

  • @ck0024
    @ck0024 6 років тому

    *Cool video. Would you please make a **_Chat System_** in near future?*

  • @obu69
    @obu69 7 років тому

    amazing video.....Thanks man

  • @ahmadverse4101
    @ahmadverse4101 4 роки тому

    Thank You Brother

  • @Kids_Darshika_TV
    @Kids_Darshika_TV 6 років тому

    Wow super ...thanks lot brother

  • @cbfreakbears312
    @cbfreakbears312 6 років тому +2

    Hey man awesome videos! Could you update the link to the Style Sheet? The one in the description is broken and I can't find them on your patreon, even after donating.

  • @oxysoxos
    @oxysoxos 6 років тому

    Excellent and easy to understand but still very practical video. Thank you very much. Keep up the good work. :-)

  • @garyhobson2002
    @garyhobson2002 5 років тому

    Please do a video how to insert data into a MySQL database with ajax and jquery! Your tutorials are fantastic. @mmtuts

  • @dmasb
    @dmasb 7 років тому

    Uppskattar dina lektioner enormt mycket, tack!

  • @namannbansal
    @namannbansal 4 роки тому +5

    unfortunately my form is redirecting to a new page, but your tutorial did help

  • @adamsmelcer3199
    @adamsmelcer3199 4 роки тому

    For those who wonder why you cannot pass data in load function to your php file, I found out that the syntax slightly changed. Now instead of doing {name: name, email: email..}, you have to do following: {'name': name, 'email': email...}. You just need to add items in that object to single quotes.

  • @sebam2421
    @sebam2421 7 років тому

    Heyo,
    really nice video, but i got one question left.
    Where do i insert the 'real' scrpt, which is sending the mail or insert the user into the db?
    Keep it up, my website is getting better and better just by using your tutorials :)

  • @MrDflego
    @MrDflego 5 років тому +3

    The links to the downloads give an error, where can I get the downloads from, I've check the patreon and they're not there either.

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

    you are great … where ajax with javascript I can’t find it anywhere in ur channel

  • @asifpatel9982
    @asifpatel9982 4 роки тому

    please make the video about how to make a chat box...

  • @mahirdaiyansafwaan2148
    @mahirdaiyansafwaan2148 6 років тому

    Please create more videos on Ajax

  • @shayantsital1783
    @shayantsital1783 7 років тому

    Hey awesome video. Are you going to do a video about live editing a Table

  • @DanielWeikert
    @DanielWeikert 7 років тому

    do you have a tutorial for installing the live server for php, the sql database... to follow along? Great videos by the way. Thanks

  • @jeffreyjansen
    @jeffreyjansen 5 років тому

    Great video's! But if I want to put the data of the form into a mysql database, do you have to enable the form POST method again? Or can Ajax handle this also?

  • @manoj03h
    @manoj03h 7 років тому +9

    instead of showing message on same page it is redirecting me to the next page which i redirected in form element

    • @Awesomedariness
      @Awesomedariness 6 років тому

      i got the same problem as manoj kumar .. but to use the jquery code inside of the html file is still not working for me .. any suggenstions?

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

      i have the same problem.. can someone help me?

  • @MohamedAhmed-xf2wm
    @MohamedAhmed-xf2wm 5 років тому +1

    $(".form-message").load(...), Here why we used the "form-message" in the selector ? .. why haven't we used another thing like the submit or the mail for example .. i mean what does that mean by select the message .. is that mean only the form message will be loading to the server ? and if i have used any other element like email input will it stop working? .. i mean when i apply this example on "login-form" .. which input should i select before load function ?

  • @efai
    @efai 5 років тому

    I like to use "const" for targeting elements (or other non-changeable content) and "let" for everything else what could or will be changed.. to be honest, I no longer use "var" at all.. main reason is hoisting and because the "let" have same behavior as variables in other languages..

  • @TV-vu9fg
    @TV-vu9fg 6 років тому +3

    In the end,you add a in the php backend file,which makes me a little confused.Can we do like that at anywhere?Or there are some rules.

    • @Dani_Krossing
      @Dani_Krossing  6 років тому

      I haven't seen this video through for a long time, but I think what you refer to is the JavaScript code I added. In that case then yes we can add JavaScript in PHP files :) However it is a good idea not to add JavaScript inside pure PHP script files. I'm not sure if I did that here in this video...

    • @sociocritical
      @sociocritical 6 років тому

      I think it works because the ajax will return everything which is echoed in the php + everything that is outside of the php tags. So it will basically embed the echo which is the span with the error message and the script outside of the php tags into the tag with the "form-message" class. (It works because you can place scripts with the tag anywhere in the html document i think) Embedding script like that even automatically sounds like bad style to me. Correct me if Im wrong though since Im just starting web development. Id rather try to return the booleans as JSON and let a script that is already loaded into the site handle it. But that would probably be much more challenging to work through.

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

      Inserting Javascript code inside the PHP file will create a big issue with the response. The response string infact will contain also the JS code and this is not good if you want to handle the script with a if(response=ok) do this.

  • @kerryruddock5879
    @kerryruddock5879 7 років тому

    Hi. Hope you don't mind a few questions regarding your tutorial. 1) Can we use index.html instead of index.php? I don't see a reason why this needs to be a php file. 2) Do you see any problem with using an earlier version of jQuery prior to version 3.0 as I would like to use your example in my webpage that is based on a template using an earlier version of jQuery. 3) Does your PHP code properly sanitize the incoming contact information? I know just enough php to be aware that Cross Server Scripting attacks can occur when data in not filtered. I didn't hear any mention that your code is filtering all of the data. 4) A suggestion. Some type of spam security such as google's reCaptcha implement in your tutorial would gave been great. Thank you for a great video.

  • @onyekachidaniel9387
    @onyekachidaniel9387 7 років тому

    Nice one love your tutorials from php to ajax but please I plead that you prepare a video on a complete chat box with PHP, MYSQL and AJAX(i mean a live chat) thank you so much

  • @omdevobhava
    @omdevobhava 6 років тому

    Nice videos, Always helped me lots. Will you can create multiple fields value in one form (Like: text field, checkbox fields, image upload/multiple image upload) how to insert and edit all their values into database by using "AJAX".
    Kindly do it for us. Thank you very much.

  • @bundas2011
    @bundas2011 4 роки тому

    can I use separated parallel check with PHP and jquery?

  • @Bestwon7900
    @Bestwon7900 5 років тому

    Nice work

  • @HowtheHutch
    @HowtheHutch 6 років тому

    Great video, but Lesson files are not available ??!!! Help please.

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

    great video, but at the last bit with mail.php at the last else with echo "span class=form-success" you never change the text to "Email has been sent". Unless correct me if i'm wrong

  • @birhatch-faiq1490
    @birhatch-faiq1490 3 роки тому

    Thank you bro 😍 but i have a Q in script tag idon’t have form-message what I write on .load()

  • @jdevcast6527
    @jdevcast6527 7 років тому +1

    How do you clear all values from the form after submission?

  • @aris1282
    @aris1282 7 років тому

    amazing videooo guys. i like video

  • @gunsnroses2570
    @gunsnroses2570 5 років тому

    Hi , thanks for your videos , learned so much :) can you do a AJAX +Laravel tutorial next ?

  • @ablamohamedamine
    @ablamohamedamine 6 років тому

    Thanks a lot man, you're the best ! :D

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

    can we use $.post instead of load?

  • @ridosh
    @ridosh 3 роки тому +4

    did i just hear you take a sip of coffee at the very end? XD

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

      Definitely he did :}

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

      @@domnsync verdade amigo , obrigado .... !! kskskssk

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

      @@KaikSilva_Ss 😉

  • @ambotlang1810
    @ambotlang1810 5 років тому

    Sir, please create ajax upload progress tutorial.

  • @isabelphillips451
    @isabelphillips451 5 років тому

    Thanks for this wonderful tutorial, how can I use this validation method in WordPress with action="" ?

  • @ademineshat
    @ademineshat 6 років тому

    Thanks. I wonder why you didn't use "post" in ajax! Everywhere i looked they all used it. What's the difference please?