This guy made some mistakes...he didn't write 'return false;' after if condition when name and message fields r empty..and he forgot to put curleybraces('( )') after setTimeOut function..
i wanted to diss on this video about the voice but after i watched the whole tut, i can say its the best tutorial i had today... good work bro... very understandable
Ya man , suppose that some 10 fields are required and 9 field fill after click submit button then message came all field required and form reset so how can we say if data success then reset otherwise don't need to reset form can you tell me in a comment please reply.
I have a question. about $.ajax (); Data{name:name,message:message} the first is the name of my field in html and the second is the value of the .val() ? so , jquery will assign in the html field called 'name' the value of the name? ($('#name').val() ) ? Could you explain the communication between html form, php and jquery. I mean the whole process /mechanism / technique thank you for your time
Hi, it works! but my form is at the bottom of my page so when I hit the submit button it goes to the top of the page. how do i make it stay on the bottom after hitting the submit button so the form is still in view so the user can see the error or success message?
Hello , if the user dosen't fill the form and he clicks submit it will display it the error that's okay but the data is gonna be inserted into the database anyway ! there is nothing that gonna stop it from executing the Sql code
hi adeel, in ajax data option we have to first name is the name which we have use on php code and second name is value of name variable which we have define above, suppose in first name you have write first name then in php code you have to write $_POST["first_name] variable instead of $_POST["name] variable.
I used the code that you provide, but unfortunately the form isn't submitted for some reason! Any ideas? the red message "all fields required works fine"...
Webslesson There is no Full Form Validation in your Entire Channel, What am looking for is a 2 Layer (Jquery and Php ) Validation of a Web-Form to Email
This guy made some mistakes...he didn't write 'return false;' after if condition when name and message fields r empty..and he forgot to put curleybraces('( )') after setTimeOut function..
Thank you so much best tutorial
that "friends" is so so annoying... only scummers and terrorists say "friends" out of context....
i wanted to diss on this video about the voice but after i watched the whole tut, i can say its the best tutorial i had today... good work bro... very understandable
its not working. not even validating the form
post your code here
very good video friend
Tried every bit of this tutorial, but mine seems not to be working. Will appreciate a help.Thanks
Form code:
Ajax and Jquery:
$(document).ready(function(){
$("#submit").click(function(){
var name = $("#form_name").val();
var email = $("#form_email").val();
var phone = $("#form_phone").val();
var subject = $("#form_subject").val();
var message = $("#form_message").val();
if(name =="" || email =="" || phone =="" || subject =="" || message =="")
{
$("#error_message").html("All fields are required");
}
else
{
$("#error_message").html("");
$.ajax({
url:"insert.php",
method: "POST",
data: {name:name},
success: function(data){
$("form").trigger("reset");
$("#success_message").fadeIn().html(data);
setTimeOut(function(){
$("#success_message").fadeOut("slow");
}, 2000));
}
});
}
return false;
});
});
PHP:
thanks sir...
it was awesome
Thank you 🤗🤗🤗
Ya man , suppose that some 10 fields are required and 9 field fill after click submit button then message came all field required and form reset so how can we say if data success then reset otherwise don't need to reset form can you tell me in a comment please reply.
Ok, friend
this channel is the best source for ajax
Thank you, have a nice day!
On the line setTimeOut needs to be: setTimeOut(function() instead of setTimeOut(function( //mind the ROUND brackets
Yeah you are right...tnx man ;)
You're welcome!
I have a question. about $.ajax ();
Data{name:name,message:message}
the first is the name of my field in html and the second is the value of the .val() ?
so , jquery will assign in the html field called 'name' the value of the name? ($('#name').val() ) ?
Could you explain the communication between html form, php and jquery. I mean the whole process /mechanism / technique
thank you for your time
Dear Webslesson, i have a problem to print the message inside the html.
my code is not working..
please help me....
very nice, 100 likes, thanks for such post, it's very helpful.
Nice video sir, but i want reset my form any error in validation through PHP. Please make video on this or please provide a link if you already have.
succes message is shoing but still page is reloading.Why that is happening
for data fetching ..... $(this).serialize(); is cooler
Hi, it works! but my form is at the bottom of my page so when I hit the submit button it goes to the top of the page. how do i make it stay on the bottom after hitting the submit button so the form is still in view so the user can see the error or success message?
Can u make a Video on Sending email from Localhost using Ajax and PHP? please
What I am really looking for! Thank you for saving me!!
Please create php CSRF ajax protection
Nice but not working with tinymce plugin.
Im not your friend.
This is greate video for Ajax, it is also usefull
Great video man, in my case the code worked with "type" instead of "method" but the rest is pretty good.
Hello , if the user dosen't fill the form and he clicks submit it will display it the error that's okay but the data is gonna be inserted into the database anyway ! there is nothing that gonna stop it from executing the Sql code
use if else to validate the submission
nice code tysm
is sql injection possible
?
sir plz tell me in ajax call what was name:name first name was the name we entered what is second name thnkx ???
hi adeel, in ajax data option we have to first name is the name which we have use on php code and second name is value of name variable which we have define above, suppose in first name you have write first name then in php code you have to write $_POST["first_name] variable instead of $_POST["name] variable.
not wrking
I used the code that you provide, but unfortunately the form isn't submitted for some reason! Any ideas? the red message "all fields required works fine"...
Have you include jquery file or not...
Forget it, my mistake it's totaly working! Thanks for this code!
so helpful
Thank you Sumit Sharma for your kind words.
neek hai
Hi sir
thanks man! helps me a lot!
HI Can you make a Video on Full Form Validation using Jquery , AJAX and PHP (Form to Email )
Hi kiran we have already publish form validation using jquery Ajax and PHP, please search our channel you can find this type of tutorial.
Webslesson
There is no Full Form Validation in your Entire Channel, What am looking for is a 2 Layer (Jquery and Php ) Validation of a Web-Form to Email
Excelente video, tengo una pregunta, como puedo hacer para que el mensaje de success dure mas tiempo, pues se quita a los 2 segudos
Thank you Karla Chavez for your gentle words.
awesome work man, keep going, boss
Thanks Robi...
thank you sir...
I just love all your videos. Keep going.
Thanks Venkey...
thanks you soo mutch
Thanks...
great 👍
Dear Animesh Manna, you are most welcome. Stay connected with us.
can anyone share the correct code? the one on url is incorrect :/