If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
January 21, 2012 at 6:43 am #8376
I have the native contact form working just fine on my contact page. (well almost. it send the message but the page refreshes. Your live sample send it much more gracefully with AJAX. How can I do this?
Secondly, I tried lifting this same code that is working in the template_contact and placing it between a conditional statement on my page.php page so that the form appears on another page and the error checking works but the form never gets sent as it does not show success message. The only item I changed was one of the form input fields.
<p><input name=”website” class=”text_input” type=”text” id=”website” size=”20″ value=”<?php if (isset($the_website)) echo $the_website?>”/><label for=”website”>Website</label></p>
<p><input name=”telephone” class=”text_input” type=”text” id=”telephone” size=”20″ value='<?php if (isset($the_telephone)) echo $the_telephone?>’/><label for=”telephone”>Telephone</label></p>
I also changed this code block in send.php
$the_name = $_POST;
$the_email = $_POST;
$the_telephone = $_POST;
$the_message = $_POST;
$the_subject = $_POST;
# want to add aditional fields? just add them to the form in template_contact.php,
# you dont have to edit this file
//added fields that are not set explicit like the ones above are combined and added before the actual message
$already_used = array(‘yourname’,’email’,’telephone’,’message’,’subject’,’ajax’,’myemail’,’myblogname’,’Send’);
$attach = ”;
The line above “$the_telephone = $_POST;” use to be $the_website = $_POST;
What could be wrong??
ThanksJanuary 21, 2012 at 2:44 pm #61185
I figured out my own problem with adding a new form on a separate page. I had to include all fields that were in the array on the sen.php page.
With that out of the way can you please help me figure out why my form seems to display the success message but not in the manner that I see on your live site? It does not appear to be using AJAX.
ThanksJanuary 21, 2012 at 7:37 pm #61186
the ajax function can be found in js/custom.js (the code after following line:)
$.fn.kriesi_ajax_form = function(options)
As far as I know it just checks following elements: textarea, select, input:text, input[type=hidden] with the class “is_empty” or “is_email”. Other input fields or validation tests are not supported (out of the box).January 22, 2012 at 2:21 am #61187
It’s not the validation that I am trying to achieve.
It’s when a user clicks submit. On your working sample the page does not refresh and a user will see the feedback immediately that the message was sent. On my form it feels like the old way of submission, whereby the page refreshes itself and then you see the success feedback.
Can you see the difference?
The topic ‘Newscast Contact Form’ is closed to new replies.