hjkhjkjhkhjkgjghjhgjhgjghjhghjghjhgjjnbvnvbnvk
bnmbnmbnhjkhjkhjkhjktyutyutyuytutyutyutyhgjgjghjgjghjguytutyry
/
home
/
anandaob
/
public_html
/
Upload FileeE
HOME
<!-- =================================================== --> <h4 class="sent-notification"></h4> <form id="msgForm"> <h2>Send an Email</h2> <label>First Name</label> <input id="fname" type="text" placeholder="Enter First Name"> <br><br> <label>Last Name</label> <input id="lname" type="text" placeholder="Enter Last Name"> <br><br> <label>Email</label> <input id="email" type="text" placeholder="Enter Email"> <br><br> <label>Subject</label> <input id="subject" type="text" placeholder=" Enter Subject"> <br><br> <label>Comment</label> <textarea id="comment" maxlength="1000" cols="25" rows="6" rows="5" placeholder="Type Message"></textarea> <br><br> <input type="submit" onclick="sendEmail()" value="Submit"> </form> <!-- =============================================== --> <script src="http://code.jquery.com/jquery-3.3.1.min.js"></script> <script type="text/javascript"> function sendEmail() { var fname = $("#fname"); var lname = $("#lname"); var email = $("#email"); var subject = $("#subject"); var comment = $("#comment"); if (isNotEmpty(fname) && isNotEmpty(lname) && isNotEmpty(email) && isNotEmpty(subject) && isNotEmpty(comment)) { $.ajax({ url: 'sendEmail.php', method: 'POST', dataType: 'json', data: { fname: fname.val(), lname: lname.val(), email: email.val(), subject: subject.val(), comment: comment.val() }, success: function (response) { $('#msgForm')[0].reset(); $('.sent-notification').text("Message Sent Successfully."); } }); // location.reload(); document.getElementById("msgForm").reset(); } } function isNotEmpty(caller) { if (caller.val() == "") { caller.css('border', '1px solid red'); return false; } else caller.css('border', ''); return true; } </script>