contact-form

Php variable in contact form / message body

久未见 提交于 2019-12-12 02:02:31
问题 I have a contact form that is only passing over some of the form fields and i wondered if anyone can help as to why? The html form is as follows: <form enctype="multipart/form-data" method="post" action="referral.php" onsubmit="return submitForm()"> <fieldset> <div class="field"> <input name="name" id="name" type="text" class="validate" placeholder="Your Name" /> <span class="form-msg" id="name-error">Please add your name</span> </div> <div class="field here-for-next-until"> <input name=

genvalidator: check for checkbox in form validation

巧了我就是萌 提交于 2019-12-11 21:20:06
问题 I'm using genvalidator to have some tests on input fields in a form. Problem is I can't find a way to test if a checkbox has been checked. This is how all the fields are set: frmvalidator.addValidation("name","req","Insert your name"); frmvalidator.addValidation("city","req","Insert your city"); frmvalidator.addValidation("phone","req","Insert your phone number"); This is my checkbox <input type="checkbox" name="agree" id="agree "value="yes"/> How can I make it mandatory with genvalidator?

How can I make a form submit button also redirect to a specific div in the page ?

北战南征 提交于 2019-12-11 17:52:27
问题 The website i'm doing is made of a fullscreen slider, with 4 different panels. The fourth panel contains a php contact form. When I submit the form, it reloads the page from the first slider, so the user can't see the results (message sent, or any error) which are in the fourth panel, with the form. Is there any way I can make the submit button also redirect to the div containing the form ? Here is the basic markup, with the php script used : <div id="container"> <div id="div1"> <div class=

Rails 3 Contact Form, undefined method?

混江龙づ霸主 提交于 2019-12-11 16:26:33
问题 I'm building a contact form in Rails 3 using this Railscast: http://railscasts.com/episodes/326-activeattr?view=asciicast I know that the only thing I'm doing wrong is filling out where the message should be sent. I used the following code to send the message: mail(:to => "me@myemail.com") However, this doesn't seem to work, because everytime I submit the form, I get this error: NoMethodError in MessagesController#create undefined method `mail' for #<MessagesController:0x00000103734bd8>

Form submission using AJAX and handling response in Wordpress Website

放肆的年华 提交于 2019-12-11 06:16:19
问题 I have a wordpress website. I have made a contact form and it is POSTed by AJAX. Here's the code: <script type="text/javascript"> jQuery(document).ready(function(){ $("#error_box").hide(); $('#contact_form').submit(function(e){ // prevent the form from submitting normally e.preventDefault(); var na=$("#1").val(); var email2=$("#2").val(); var subject2 = $("#3").val(); var message2 = $("#4").val(); var mydata = "pn2="+na+"&email="+email2+"&subject="+subject2+"&msg="+message2; alert(mydata); $(

Success message not displaying using jQuery ajax

会有一股神秘感。 提交于 2019-12-11 05:04:02
问题 So I have verified that my contact.php (phpmailer file) is working. However at the end, given a successful response, the contact.php says echo: 'done' if(!$mail1->send()) { echo 'error'; //echo 'Mailer Error: ' . $mail->ErrorInfo; return false; } else { echo 'done'; return true; } At that point (I'm guessing since I paid a developer to create the form for me, but haven't tried to test with my own host til recently. This is the code he supplied. /************ AJAX Method *************/

Dynamicly populate Contact form 7 input fields with current user info when logged in in Wordpress website

非 Y 不嫁゛ 提交于 2019-12-11 02:18:49
问题 I've been trying to figure out how to populate input fields in contact forms on my Wordpress website. I've tried using a plugin called Contact Form 7 dynamic text extension, and tried a pretty simple IF statement with PHP. But i just can't seem to get this to work. With the plugin, i can only get half of the arguments to work in the shortcode, even then the form doesn't properly validate. Using PHP as a placeholder="" outputs the code instead of the contents of the variable. for example "

PHPMailer not working: Message could not be sent

淺唱寂寞╮ 提交于 2019-12-10 11:18:01
问题 I am trying to create a contact form on my website using PHPMailer. I am having some trouble setting it up. I am trying to use G-mail as my smtp host. I was wondering if anyone can help troubleshoot this? This is my mailer code: <?php require("class.phpmailer.php"); require("class.smtp.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; // turn on SMTP authentication $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail $mail->Host = 'smtp.gmail.com';

Automatically scroll down after submit action

前提是你 提交于 2019-12-08 20:28:27
问题 How to make my website automatically scroll down after sending e-mail from "Contact Form" which is located on the bottom of my webpage? Information about successful sending or error ouccurs below the form and after clicking that 'submit' button page is refreshing and user can see only top of the site, not the bottom... 回答1: <form id="form" action="{your_action}#form"> .... </form> 回答2: Post to an anchor tag on the page the sumbit is being sent to http://foo.com#youranchor 回答3: The action

CSRF Token Needed?

一曲冷凌霜 提交于 2019-12-08 08:32:27
问题 Ok, still trying to wrap my head around what they are, and needed for ..believe me I've read plenty on it and think I understand but I probably don't ... The closest I can get is that they're definitely needed when you have log-in pages in any form on your site ... My question is when you have basic contact form and/or fill-in form for any reason ... do you need CSRF tokens for those pages? 回答1: CSRF tokens are not 'definitely needed' (as in, forms will work without them) but they are an