Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting my AJAX error message to display
    primarykey
    data
    text
    <p>I have a success message that is displayed no matter if the user data is valid or not. I have an error message but I'm having trouble getting it to display. I'm not the best coder so be nice :)</p> <p>Also, for some reason when I receive an email via the form the user's email comes up as user@MISSING_DOMAIN. My first issue takes priority, so you don't have to help me with this one if its too much. </p> <p>Form Code</p> <pre><code>&lt;form action="contactformprocess3.php" method="post" class="myForm" &gt; &lt;input name="name" type="text" id="f1" class="name-textinput"/&gt;&lt;br /&gt; &lt;script type="text/javascript"&gt; var f1 = new LiveValidation('f1'); f1.add( Validate.Presence ); &lt;/script&gt; &lt;input name="email" type="text" id="f21" class="email-textinput"/&gt;&lt;br /&gt; &lt;script type="text/javascript"&gt; var f21 = new LiveValidation('f21'); f21.add( Validate.Presence ); f21.add( Validate.Email ); f21.add( Validate.Length, { minimum: 10, maximum: 35 } ); &lt;/script&gt; &lt;textarea name="message" rows="9" cols="34" id="field3" class="message-textinput"&gt;&lt;/textarea&gt; &lt;span class="underform"&gt; &lt;input type="reset" class="reset" /&gt; &lt;input type="submit" value="submit" class="submit" /&gt; &lt;/span&gt; &lt;/form&gt; </code></pre> <p>AJAX</p> <pre><code>$(function() { $('.myForm').submit(function(e) { e.preventDefault(); var form = $(this); var post_url = form.attr('action'); var post_data = form.serialize(); $.ajax({ type: 'POST', url: post_url, data: post_data, success: function(msg) { $('.success-box').fadeIn("slow").delay(3000).fadeOut("slow"); }, error: function(xhr, status, error, req) { $('.failure-box').fadein("slow").delay(3000).fadeOut("slow"); } }); }); }); </code></pre> <p>PHP EMAIL</p> <pre><code>&lt;?php $to = 'wj@pieceofmedesigns.com'; $subject = 'Piece of Me Designs'; $from = $_POST['email']; $name = $_POST['name']; $message = $_POST['message']; if (mail($to, $subject, $message, 'From: '.$name.' &amp;lt;'.$from.'&amp;gt;')) { echo 'Message was sent successfully.'; } else { echo 'There was a problem sending your message.'; } </code></pre> <p>?> </p>
    singulars
    1. This table or related slice is empty.
    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