I am currently working on one site ... and I have encountered an error ...
I am using this mail form:
jquery (document) .ready (function ($) {// hide message $ ("# error"). Hide (); $ ("# Sent-form-msg"). Submit to Hide (); // ... Click on $ ("# contactForm #submit") (function () {$ ("# Error ". ()" // "(name ==" ") {$ (" # error "). FadeIn () Text ("name is required."); $ ("Inp ("Input # email"). Val (); if (email == "") {$ ("#" ("input required" "$" ("Input # email"). Focus (); return false;} // web server web = $ ("input # web"). Val () "if" ("web" = "" ") {$ ("# Error"). FadeIn (). Text ("Web Required"); $ ("Input # Web"). Focus (Return); Returning;} // Comments var Comment = $ ("# Comments") . Val (); // Send mail php var sendMailUrl = $ ("# sendMailUrl"). Val (); // to, from & amp; Subject var = $ ("#to"). Val (); From var = $ ("#s") Val (); Var topic = $ ("#su bject") val () .; // data string var data string = 'name =' + + name + 'and amp; Email = '+ email +' and web = '+ + + web +' and comments = '+ comments +' and + '& amp; From = '+ + +' and subject = '+ subject; // ajax $ Axx ({type: "post", url: sendmail url, data: data string, success: success ()}); }); // Success ... Function Success () {$ ("# -sent-form-msg") FadeIn (); $ ("# Contactform") fadeOut () .; } return false; }); And I have it on the page: collect information and forward it to the email address.
& lt ;! - form - & gt; & Lt; Form id = "contactForm" action = "#" method = "post" / & gt; & Lt; Fieldset & gt; & Lt; P & gt; & Lt; Label = "name" & gt; Name & lt; / Label & gt; & Lt; Input name = "name" id = "name" type = "text" class = "form-poshytip" title = "enter your full name" /> & Lt; / P & gt; & Lt; P & gt; & Lt; Label = "email" & gt; Email & lt; / Labels & gt; & Lt; Input name = "email" id = "email" type = "text" class = "form-poshytip" title = "Enter your email address" / & gt; & Lt; / P & gt; & Lt; P & gt; & Lt; Label = "comments" & gt; Bericht & lt; / Label & gt; & Lt; Textarea name = "comments" id = "comments" rows = "5" cols = "20" class = "form-poshytip" title = "enter your comments" & gt; & Lt; / Textarea & gt; & Lt; / P & gt; & Lt ;! - Send mail configuration - & gt; & Lt; Input type = "hidden" value = "kai.zaper@gmail.com" name = "to" id = "from" /> & Lt; Input type = "hidden" value = "jbeuk email form mail" name = "topic" id = "topic" /> & Lt; Input type = "hidden" value = "send-mail.php" name = "sendMailUrl" id = "sendMailUrl" /> & Lt ;! - Send ENDS mail configuration - & gt; & Lt; P & gt; & Lt; Input type = "button" value = "send" name = "submit" id = "submit" /> & Lt; Span id = "error" class = "warning" & gt; Oops, er iets fout gegaan, investigator opnieuw. & Lt; / Span & gt; & Lt; / P & gt; & Lt; / Fieldset & gt; & Lt; / Form & gt; & Lt; P id = "Sent-form-msg" class = "success" & gt; UV email is verzonden. & Lt; / P & gt; & Lt ;! - ENDS form - & gt; But this is not sending any email, can anyone help?
It looks conflicting with $ and jQuery < / Code>. Announce $ NoConflict (); Example: $ NoConflict (); JQuery (document) .ready (function ($) {// Hide message $ ("# error"). Hide (); ... ... ...}); OR Use either like this
jQuery (document) .ready (function () {// Hide message jQuery ("# Error") Hide (); ... ... ...}); or such a way
$ (document) .ready (function () {// Hide message $ ("# error"). Hide (); ... ... ...}); View documentation about
Comments
Post a Comment