Creating an AJAX Submit Form using JavaScript - Tutorial For Beginners

preview_player
Показать описание
View the Code and GitHub Repository:

You can use AJAX within JavaScript to create a form submission that does not require a page reload or redirection. This can enhance the user experience and you'll learn that from this video.

The code begins with a few standard HTML input fields and a submit button. When the submit button is pressed, the JavaScript code will make a request to the server which will perform the validation. The web browser will then receive a response from the server, containing information about the attempted login: whether or not it was successful AND any error messages that came with it. From there, the web browser can either display those messages or redirect the user.

In this video we'll be using the above logic to create a basic Login Form.

Support me on Patreon:

For your reference, check this out:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!

#dcode #javascript #webdev
Рекомендации по теме
Комментарии
Автор

what you have taught us is just awesome. i told you i intend to use procedural way to submit the form after the js validation. but it is more than that. i'm gonna implement this in my project. Thanks mate!

leslinks
Автор

Thank you. I wish there more YouTubers and or persons in general like you. God bless.

senju
Автор

thanks a lot for this tutorial ! I have seen a lot of tutorials but this is one the best ones :)

TomasMisura
Автор

Thanks. I've been trying to use that with prepared statements to avoid sql injection attacks, your tutorial (and some research on Stack Overflow alongside with the php docs) helped me to actually understand how to pass my params into the prepared statement function. Seeing as to how bad my usage of this is because of the repetative code I have to use in my case while writing the logic for my prepared statements, I'm better off making my own php framework or something.

omniversal
Автор

Sir how to encrypted form data while we send data through url using post/get method

andykyle
Автор

Thank You very much! You've helped me a lot! Nothing I can do for you but subscribed your channel and give you a BIGGGG thumb! You are wonderful! Thanks!

sharksean
Автор

Hi, I wanted to ask how in the beginning you link the check-login.php file to the index.html file because I don't get anything on the webpage in the network tab of inspect

shanekanyi
Автор

I have one problem --> this check-login.php is going on post as an action to server and response with answer but I had another php file going on post action and I don't know how to merge this 2 different php file and make one file to say to server as post and get them to work too
any Solution???

better_vet
Автор

My current dilemma is that the form works and sends the info to the mysql database but it's all in small letters even if I'm using caps lock, I want to be able to use small and capital letters so how do I accomplish it?

LoveAntifa
Автор

Thanks a lot 'dcode' I learned it completely ♥

sajadgholami
Автор

thank you for this, i have problem when i try to get responseObj = JSON.parse(xhr.responseText) console log to me Unexpected token < in JSON at position 0 :(

medooaattya
Автор

awesome, videos like this with this level it helps a lot, I wonder if you can make a contact form with captcha, and button to update the recatcha, php ajax and native javascript, since it is appreciated for everything

moisescastillo
Автор

Thank u so much for such a valuable tutorials...❤❤

TutunSadhukhan
Автор

I did it successfully as your tutorial. I'm using it in a multi-step form. I want to hide the login form and show another module from php at that same file once $_POST data will match with php condition. Thanks in advance.

naiemofficial_
Автор

Thanks you a lot, this was very clearfly

ezequieldasilva
Автор

Sir i am using firebase and npm, this web not using PHP file, if you were me what would you do ?

galihridhoutomo
Автор

Can i Integrate this with django the same way?

BLOPIsUrM
Автор

hi sir did u have tutorial using simple database for ajax tutorial

andykyle
Автор

Is the username and password is already set example the dcode?

arofficialtv
Автор

You are awesome dude!!
I wanna give you likes!!
ThNks a lot dude

musiclovers