תוסיף לכל התגיות input
required="true" זה יראה ככה: <input type="text" required="true" />
|
עכשיו תוסיף בעמוד את ההודעה "נשלח בהצלחה" תעצב אותה ותשים מתחת לטופס ותוסיף לה את זה:
id="contactSuccess" style="display:none"
|
אחרי שעשית את זה תשנה את הקוד שנתתי לך בהתחלה לזה:
<script> $("#contactForm").submit(function() { var url = "form.php"; $.ajax({ type: "POST", url: url, data: $("#contactForm").serialize(), // serializes the form's elements. success: function(data) { $$('#contactSuccess').show(); } }); return false; // avoid to execute the actual submit of the form. }); </script>
|