Note that there are some explanatory texts on larger screens.

plurals
  1. POValidation with Jquery Form Plugin
    primarykey
    data
    text
    <p>This is the first time I have attempted to make a form using jquery and php. I used the folks over at Mid Mo Design as an example but even with that tutorial am still having trouble getting it to do what I want. This is the code I have been using. As well as jquery 1.4.1 and jQuery Form Plugin 2.43. Any help would be greatly appreciated.</p> <p>css</p> <pre><code>#scrollContact { border-top: double 1px #0D0D0D; padding: 100px 50px 50px 50px; background: #020303; position: relative; overflow: hidden; width: 924px; text-align: justify; } .contactInfo { float:left; width: 214px; margin-right: 10px; margin-top: 5px; } #contactForm { float: left; width: 700px; } #contactForm span { float: left; margin:5px; width: 455px; } input, textarea { -moz-border-radius:5px 5px 5px 5px; border:1px solid #001932; color:#BBBBBB; font:1.1em Verdana,Geneva,sans-serif; background: #0A0A0A; } input:hover, textarea:hover { border:1px solid #0278f2; background: #242424; } #contactForm span input { line-height:1.8em; width:430px; padding:11px 10px; margin: 0px 0px 10px 0px; } #contactForm input { line-height:1.8em; width:200px; padding:11px 10px; margin: 5px; } #contactForm textarea { height:190px; line-height:1.8em; width:430px; padding:10px; } .message { background:#eee; color:#000; display:none; padding:10px; height: 70px; position: absolute; bottom:0px; } </code></pre> <p>Html</p> <pre><code> &lt;div id="scrollContact" name="scrollContact"&gt; &lt;div class="title"&gt; &lt;h2 class="titleContact"&gt;Contact&lt;/h2&gt; &lt;ul class="pagenav"&gt; &lt;li class="pagenavTitle"&gt;Navigate To:&lt;/li&gt; &lt;li class="pagenavWork"&gt;&lt;a title="work" href="#scrollWork"&gt;Work&lt;/a&gt;&lt;/li&gt; &lt;li class="pagenavServices"&gt;&lt;a title="services" href="#scrollServices"&gt;services&lt;/a&gt;&lt;/li&gt; &lt;li class="pagenavAbout"&gt;&lt;a title="about" href="#scrollAbout"&gt;about&lt;/a&gt;&lt;/li&gt; &lt;li class="pagenavContact"&gt;&lt;a title="contact" href="#scrollContact"&gt;contact&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="contactInfo"&gt; &lt;strong&gt;Get A Free Quote&lt;/strong&gt;&lt;br /&gt; Thank you for your interest in contacting me. Please use the form to the right to contact me via email. I will respond to your inquiry as soon as possible. Please note all fields are required. &lt;br /&gt; &lt;strong&gt;What Next?&lt;/strong&gt; &lt;br /&gt; Thank you for your interest in contacting me. Please use the form to the right to contact me via email. I will respond to your inquiry as soon as possible. Please note all fields are required. &lt;/div&gt; &lt;form action="bin/sendmail.php" method="post" id="contactForm"&gt; &lt;span&gt; &lt;input type="text" name="contactTitle" value="" id="contactTitle" title="Subject" /&gt; &lt;textarea rows="5" name="contactMessage"&gt;Your Message&lt;/textarea&gt; &lt;/span&gt; &lt;input type="text" name="contactName" value="" id="contactName" title="Your Name"/&gt; &lt;input type="text" name="contactEmail" value="" id="contactEmail" title="Your Email" /&gt; &lt;input class="contactButton" type="submit" name="submit" title="Submit Form" /&gt; &lt;/form&gt; &lt;div class="message"&gt;&lt;div id="alert"&gt;&lt;/div&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>Php</p> <pre><code> &lt;?php $sendto = 'my@email.com'; $subject = 'Contact from contact form'; $errormessage = 'Oops! There seems to have been a problem. May we suggest...'; $thanks = "Thanks for the email! We'll get back to you as soon as possible!"; $honeypot = "You filled in the honeypot! If you're human, try again!"; $emptyname = 'Entering your name?'; $emptyemail = 'Entering your email address?'; $emptytitle = 'Entering The Subject?'; $emptymessage = 'Entering a message?'; $alertname = 'Entering your name using only the standard alphabet?'; $alertemail = 'Entering your email in this format: &lt;i&gt;name@example.com&lt;/i&gt;?'; $alerttitle = 'Entering the subject using only the standard alphabet?'; $alertmessage = "Making sure you aren't using any parenthesis or other escaping characters in the message? Most URLS are fine though!"; $alert = ''; $pass = 0; function clean_var($variable) { $variable = strip_tags(stripslashes(trim(rtrim($variable)))); return $variable; } if ( empty($_REQUEST['last']) ) { if ( empty($_REQUEST['contactName']) ) { $pass = 1; $alert .= "&lt;li&gt;" . $emptyname . "&lt;/li&gt;"; } elseif ( ereg( "[][{}()*+?.\\^$|]", $_REQUEST['contactName'] ) ) { $pass = 1; $alert .= "&lt;li&gt;" . $alertname . "&lt;/li&gt;"; } if ( empty($_REQUEST['contactEmail']) ) { $pass = 1; $alert .= "&lt;li&gt;" . $emptyemail . "&lt;/li&gt;"; } elseif ( !eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_REQUEST['contactEmail']) ) { $pass = 1; $alert .= "&lt;li&gt;" . $alertemail . "&lt;/li&gt;"; } if ( empty($_REQUEST['contactTitle']) ) { $pass = 1; $alert .= "&lt;li&gt;" . $emptytitle . "&lt;/li&gt;"; } elseif ( ereg( "[][{}()*+?.\\^$|]", $_REQUEST['contactTitle'] ) ) { $pass = 1; $alert .= "&lt;li&gt;" . $alerttitle . "&lt;/li&gt;"; } if ( empty($_REQUEST['contactMessage']) ) { $pass = 1; $alert .= "&lt;li&gt;" . $emptymessage . "&lt;/li&gt;"; } elseif ( ereg( "[][{}()*+?\\^$|]", $_REQUEST['contactMessage'] ) ) { $pass = 1; $alert .= "&lt;li&gt;" . $alertmessage . "&lt;/li&gt;"; } if ( $pass==1 ) { echo "&lt;script&gt;$(\".message\").hide(\"slow\").show(\"slow\"); &lt;/script&gt;"; echo "&lt;b&gt;" . $errormessage . "&lt;/b&gt;"; echo "&lt;ul&gt;"; echo $alert; echo "&lt;/ul&gt;"; } elseif (isset($_REQUEST['message'])) { $message = "From: " . clean_var($_REQUEST['contactName']) . "\n"; $message .= "Email: " . clean_var($_REQUEST['contactEmail']) . "\n"; $message .= "Telephone: " . clean_var($_REQUEST['contactTitle']) . "\n"; $message .= "Message: \n" . clean_var($_REQUEST['contactMessage']); $header = 'From:'. clean_var($_REQUEST['contactEmail']); mail($sendto, $subject, $message, $header); echo "&lt;script&gt;$(\".message\").hide(\"slow\").show(\"slow\").animate({opacity: 1.0}, 4000).hide(\"slow\"); $(':input').clearForm() &lt;/script&gt;"; echo $thanks; die(); } } else { echo "&lt;script&gt;$(\".message\").hide(\"slow\").show(\"slow\"); &lt;/script&gt;"; echo $honeypot; } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload