AJAX form submission using jQuery and PHP (part 3)

preview_player
Показать описание
Submit your forms without page refresh using jQuery's AJAX functions. This tutorial shows how to add client side validation and form submission by AJAX. We will also re-validate the submitted form on the server using a PHP script and return a success or error message to the user. Get it all done without ever having to reload or refresh the page.
In this lesson we finish up our client side validation and AJAX submit logic. In the next lesson we'll write our PHP script and finish up the application.
Рекомендации по теме
Комментарии
Автор

this is actually starting to make sense to me now...great job

MrShawnlloyd
Автор

@wormracer08 - Thanks for this awesome tutorial! Nicely paced for us AJAX noobs!!!

LearnThruSong
Автор

It would be nice if you could extend this tutorial to include how to send user info. to my email.
Thanks. Nice tutorial :)

VictorGalaxy
Автор

I loved your video, very well paced. Would you still have the codes available for download. Thank you so very much.

ledcadmin
Автор

BTW - on the PHP side, you should use the mysql_real_escape_string() that prepends backslashes to some potentially harmful characters

LearnThruSong
Автор

@wormracer08 Gotcha. Very cool. I have a contact form on my site but this one is WAY better. When I'm done with it, I'll send you the link to get your feedback.

Thanks for doing these videos! Much appreciated.

WatchTheShark
Автор

Great tutorials! One question. Do I just add the mail function in the php script to submit it?

bigbos
Автор

well you can do every evaluation of the data inside the php which is more professional way of doing this and then display the return with ajax

Hobypyrocom
Автор

Where did you find the code for the email.match line that follows the 2nd if statement?

By the way, the honeypot trick is pretty cool. I haven't seen that one before.

WatchTheShark
Автор

Very well explainded.Can I get the source codes.

muhammadsaadsalman
Автор

Great videos. This is my first site and is for my band. However, After the processing, I get the error message instead of the success message but still receive the email. any thoughts?

bigbos
Автор

HI. i love this video. one question though; my AJAX part of the script is not working. i keep getting this message; SyntaxError: JSON.parse: unexpected character error due to a parsererror condition.

i note that other people had the same problem; can you please tell me how it was resoved.

warm regards

Andreea

paulkendal
Автор

can you please explain me 3 things why have you used and exclamation for email and not for name and what is the use of ||

rajataudichya
Автор

would it be possible to do all the validation with PHP?

VirtousOn
Автор

hi am also interested in the code. Would this also work with a file upload field ? tx

nxigaming
Автор

you should make the email checking in the php not inside the java guess why? java is downloaded on client side which is editable and php is not. :) just a note everything else is perfect.

Hobypyrocom
Автор

i did every thing based on your tutorial and this is what i get as response
Oops! The request was successful but your form is not filled out correctly.
".$error_message; echo json_encode($return); exit(); } else { $return['error'] = false; $return['msg'] = "

Thanks for your feedback " .$name .".
"; echo json_encode($return); } } else { $return['error'] = true; $return['msg'] = "

ataho
Автор

why on EARTH would you use a variable to hold " is required" when you have to output a string for each error anyway!! Just one of the reasons this video and the entire series could have been 10min stead of almost an hour!

GifCoDigital
visit shbcf.ru