WordPress.org

Ready to get started?Download WordPress

Forums

Custom Contact Form - Page Not Found? (2 posts)

  1. zkarmi25
    Member
    Posted 4 years ago #

    Hello,

    I'm having a problem with my contact form. It is a script I wrote myself, and it should be working right. I have a jQuery script that is supposed to help validate it and process it without refresh.
    The problem is that for some reason, neither the PHP script nor the jQuery script can seem to find my contact page. This doesn't make sense, because they're both on the contact page. When I click "submit", the script sends me to my 404 page:

    <form id="contactme" action="<?php the_permalink(); ?>" method="post">
    	<fieldset>
    		<label for="name" class="error"<?php if($nameError) echo ' style="display: block;"'?>>Please provide a name</label>
    		<input type="text" name="name" id="name" size="40" maxlength="50" value="name" onfocus="if(this.value=='name') this.value='';" onblur="if(this.value=='') this.value='name';" />
    
    		<label for="email" class="error"<?php if($emailError) echo ' style="display: block;"'?>>Please provide a valid e-mail address</label>
    		<input type="text" name="email" id="email" size="40" maxlength="50" value="email" onfocus="if(this.value=='email') this.value='';" onblur="if(this.value=='') this.value='email';" />
    
    		<label for="subject" class="error"<?php if($subjectError) echo ' style="display: block;"'?>>Please provide a subject</label>
    		<input type="text" name="subject" id="subject" size="40" maxlength="150" value="subject" onfocus="if(this.value=='subject') this.value='';" onblur="if(this.value=='') this.value='subject';" />
    
    		<label for="message" class="error"<?php if($messageError) echo ' style="display: block;"'?>>Please provide a message</label>
    		<textarea name="message" id="message" rows="8" cols="43" onfocus="if(this.value=='message') this.value='';" onblur="if(this.value=='') this.value='message';" >message</textarea>
    
    		<input type="hidden" name="js" id="js" value="1" />
    		<input type="submit" id="submit" value="submit" />
    	</fieldset>
    </form>

    If anyone can tell me why I am having this problem, I would greatly appreciate it. I've used an almost identical script on another WordPress site I made, and it works perfectly. I am hosted by Dreamhost, if that makes a difference.

  2. zkarmi25
    Member
    Posted 4 years ago #

    Update: It seems if I instead put the php processing script in a separate file, the e-mail sends just fine. The only problem with this is that I can't seem to get jQuery's $.ajax() to trigger the "success" attribute after. Anyone know how I can accomplish this?

Topic Closed

This topic has been closed to new replies.

About this Topic