Jump to content

Search the Community

Showing results for tags 'Form'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 122 results

  1. bat

    Html drop down menu

    I am attempting to create a drop down menu and I liked the style of the top home menu seen here http://www.lego.com/en-us/products (right near the lego symbol) but I am not sure how to create a similar one would some one gI've me guidance on how I can do this I just started html coding so I am a noon with little knowledge of html right now.
  2. j.silver

    Capturin Data in Contact us Form

    What is the best way of capturing data sent via a contact-us form (I am using form and PHP)--in DB only, in a dedicated email only, or in both? Pros and cons of each method please, if possible.
  3. sspolice

    Template Form

    Hello guys am practically a day old here so i am not a pro with dreamweaver but i know sort of my way around but i am so puzzled and hope i can get help fast, so i downloaded a template and there is a form but i dont know what the ###### is goin on haha. DW has it own form but this one goes with the template so yes. below is the code , if any one could help me i would be greatful ! and yes am learning <form id="form" method="post" > <fieldset> <label><strong>Name:</strong><input type="text" value=""></label> <label><strong>Email:</strong><input type="text" value=""></label> <label><strong>Phone:</strong><input type="text" value=""></label> <label><strong>Message:</strong><textarea></textarea></label> <div class="btns"><a href="#" class="link">Clear</a><a href="#" class="link" onClick="document.getElementById('form').submit()">Send</a></div> </fieldset> </form> that's all that there is but it need to send to a mail and i dont know if it needs a thank you page or redirect to home afterwards once the website is up i shall post the link... Regards Rory
  4. WesleyA

    block similar character sequence

    I'm looking for a way to block input in a text field occuring more than 5 times. For example aaaaaa is wrong but: A sentence having an input of a happening several times or even more is okay. above sentence has 7 inputs and shouldnt be blocked. What is the solution?
  5. when working with $_SESSION and creating a super global then in the script where I use include and call the variable the entire form is showing up. I have to work with $_SESSION, because $_POST or $_GET wont work in this situation. Is there a way to transfer a form value to another script, and then a single value and not the complete form with everything in it.
  6. wesley

    align form with css

    Hello, I have make a form. But the form is not align. I want to have spece between the label and the input, like in the image. The dual column example you see space between the label and the input. My question is: how can I make this? My css is: label{ display:block; color: white; margin:12px; padding: 12px; }input{ height:40px; width: 190px; font-size:20px;} thanks in advance.
  7. stulleman

    Form Validation

    Hello Forum! I have a little problem. What I have is a registration page. I want to validate the input of the user in real time. I use JQuery. $("#inputUsername").change(checkUsername); $("#inputEmail").change(checkEmail); $("#inputPassword").change(checkPassword); $("#inputPasswordConfirm").change(checkPasswordConfirm); I check if something was changed. For example like this: function checkUsername() { $(this).popover({placement:"right", container:'body'}); var username = $(this).val(); if(username == '') { $(this).data('bs.popover').options.content = 'Please enter a username'; $(this).popover("show"); } else if(username.length < 5 || username.length > 20) { $(this).data('bs.popover').options.content = 'Please enter a username with 5-20 characters'; $(this).popover("show"); } else { $(this).popover("destroy"); } } Now when the user submits the form, I thought I could use something like this: $("#registerForm").submit(function( event ) { if(!checkUsername || !checkEmail || !checkPassword || !checkPasswordConfirm) { event.preventDefault(); } }); Obviously the functions don't have return types. But even with it doesn't work. With it doesn't work I mean that submit event isn't ignored even if there are errors in the form. I might be doing something wrong with JavaScript as I'm not used to it! Before someone suggests a plugin, I don't have enough control with them. Thanks!
  8. lorifaith

    comment on websit

    please i need help on how to create a comment box so that people can comment on my sit when they visit thanks
  9. Hello, I was unable to find a solution for this problem. I'm hoping someone knows the answer. I have a mobile website and a phone number you can click to call. I even made it a hyperlink tel:###-###-####. This works correctly. I have a hidden form with a comment field only that basically says "Someone from your website placed a call to you." What I want to do is when the user clicks to call the number on the website call my number and send a quick Email letting me know by submitting the form I just mentioned along with the time and date. I have a php file working that sends the email to me when I hit the submit button. I have the hyperlink opening the box to allow the call to be placed. What I can't seem to figure out is how to get both things done on that one click of the phone number. ANY HELP would be appreciated. I understand that php is server side and the click to call is client side. But I'm still lost.
  10. Everton

    Problem form

    I'm a beginnerI have an error in the contact form where the data fields are not being sent to the targeted email.Please helpWhat did I do wrong? <!-- contact --> <div class="contact" id="reservations"> <div class="col-md-4 contact-left"> <div class="contact-left1"> <img src="images/logo5.png" class="img-responsive" alt=""> <h3>RESERVAS</h3> </div> </div> <div class="col-md-8 contact-right" id="contact"> <div class="contact-details"> <h3>CONTATO</h3> <div class="text-field-name-1"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> .<br /><br /> <input type="text" class="text" value=" Nome completo*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Name*';}"> <input type="text" class="text" value="País / Estado*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Surname*';}"> <input type="text" class="text" value=" Facebook*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Country';}"> <input type="text" class="text" value="Email*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email*';}"> <input type="text" class="text" value=" Telefone / Celular*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Phone*';}"> </form> </div> </div> <div class="reservation-details"> <h3>DETALHES DA RESERVA</h3> <div class="text-field-name-1"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> .<br /><br /> <input type="text" class="text" value=" Check-in*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Arrival Date*';}"> <input type="text" class="text" value=" Check-out*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Departure Date*';}"> <input type="text" class="text" value=" Tipo de Quarto*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Rooms*';}"> </form> </div> <div class="text-field-name-2"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> <input type="text" class="text" value="Quartos*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Departure Date*';}"> <input type="text" class="text" value=" Qde Pessosas*" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ' Rooms*';}"> </form> <label class="checkbox"><input type="checkbox" name="checkbox" checked=""><i> </i>Privacy</label> </div> </div> <div class="clearfix"> </div> <div class="button"> <form action="http://www.pousadaestacaodaserra.com/cgi-sys/formmail.pl" method="post"> <input type="hidden" name="recipient" value="contato@pousadaestacaodaserra.com"> <input type="hidden" name="subject" value="FormMail E-Mail"> <input type="submit" name="submit" value="Enviar Mensagem"> <input type="hidden" name="redirect" value="http://pousadaestacaodaserra.com/paginaok.html"> </form> </div> </div> <div class="clearfix"> </div> </div><!-- contact -->
  11. jaylow

    can not INSERT INTO getting a error.

    Hello, i am having issues adding info to a database i have a html from where a user should fill in charname and select ###### then press submit. if i do this i get the error ERROR:could not able to execute INSERT INTO character(charname, ######, xp, gold, accdate) VALUES(jay, male, 0, 100000, now()).You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character(charname, ######, xp, gold, accdate) VALUES(jay, male, 0, 100000, now())' at line 1 <?php include_once 'db_connect.php'; include_once 'psl-config.php'; $error_msg = ""; $now = time(); // check connection if($mysqli === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } // Escape user inputs for security $charname = mysqli_real_escape_string($mysqli, $_POST['charname']); $###### = mysqli_real_escape_string($mysqli, $_POST['######']); //attempt inser quesry execution $sql = "INSERT INTO character (charname, ######, gold, xp, accdate) VALUES ($charname, $######, 100000, 0, now())"; if(mysqli_query($mysqli, $sql)){ echo "Records added successfully."; } else{ echo " ERROR:could not able to execute $sql." .mysqli_error($mysqli); } // close connection mysqli_close($mysqli); ?> Table CREATE TABLE IF NOT EXISTS `character` ( `id` int(11) NOT NULL AUTO_INCREMENT, `charname` varchar(30) NOT NULL, `######` tinyint(4) NOT NULL, `gold` int(11) NOT NULL, `xp` int(11) NOT NULL, `accdate` timestamp NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; I was wondering if some one could explain me what i do wrong, and or have some tips how to make this better. the idea is to add a check to see in the "charname" is already used. and some other stuff. but first i like to see the info end up in my DB Thanks
  12. Hello, I have recently been working on a HTML form to submit new results into a search engine. However I have ran into a problem that I cant seem to get past. I have one page where the info from the form can be properly submitted, however it requires a password to get into. (its the admin panel) located at index.php?a=admin However when a user tries to insert a new site to the form the just are denied access because they cant log into the admin panel, even though the form itself is not actually in the admin panel... The HTML form looks like this and is located in a page called /AddSite.html however its trying to submit the info to /index.php?a=admin how can I use JavaScript to possibly bypass needing the password? and not redirecting to the admin panel when you click submit? (Also, not as important as the above issue... but as you can see I tried to add a capatcha, but I cant get it to be required, users can press submit without even using the capatcha... if anyone could tell me what I did wrong that would be helpful ) my current code: <form action="/index.php?a=admin" method="post"><div class=""> Site Title: <input type="text" name="addtitle" value="" required/><br /> Site URL: <input type="url" name="addurl" value="http://" required/><br /> Site Description: <br /><textarea lass="ads" name="adddesc" required></textarea><div align="center" class="g-recaptcha" data-sitekey="6LfDoAYTAAAAAOUmPcjfwv3I84xYqFBV5tyQMPJu"></div></div><br /><input type="submit" value="Add new result"/></form> Any help works!!!
  13. I was wondering if someone could help me. We were learning some basic javascript in class and I can't seem to get my form to validate. Basically all I wanted it to do is return an error when nothing is entered in the field. I've done it the way we were taught in class via examples. Any help would be much appreciated!! index.html
  14. OllieD

    HTML form submit button

    I have st up a form on my website for contacting my company. It has some required fields for name, email and message but when you click the submit button, an alert pops up to confirm the form being submitted even when the required fields haven't been filled out. How can I solve this? This is the code for the form: <form name="Contact" method="put" id="contact"> First Name: <input type="type" name="First" id="first" maxlength="20" required placeholder="First Name"> <br> Last Name: <input type="type" name="Last" id="last" maxlength="25" required placeholder="Last Name"> <br> Email: <input type="email" name="Email" id="email" maxlength="25" required placeholder="Email"> <br> Message <input type="type" name="Message" id="message" maxlength="1000" required placeholder="Message"> <br> <input type="reset"> <input type="submit" onClick="alert('Thank you for contacting us. We will process it as soon as possible')"> </form>
  15. Hello, I'm working on a website for a friend and can't seem to figure this out but it shows email progress right on the page without even sending a email just going to website! I was wondering if someone can help me fix also diagnose why no emails are sending! Thank you Here is the PHP file: called "form-to-email" <?php/*Configuration You are to edit these configuration values. Not all of them need to be edited.However, the first few obviously need to be edited.EMAIL_RECIPIENTS - your email address where you want to get the form submission.*/$email_recipients = "support@nueroedge.com";//<<=== enter your email address here//$email_recipients = "mymanager@gmail.com,his.manager@yahoo.com"; <<=== more than one recipients like this$visitors_email_field = 'email';//The name of the field where your user enters their email address //This is handy when you want to reply to your users via email //The script will set the reply-to header of the email to this email //Leave blank if there is no email field in your form$email_subject = "New Form submission";$enable_auto_response = true;//Make this false if you donot want auto-response.//Update the following auto-response to the user$auto_response_subj = "Thanks for contacting us";$auto_response ="HiThanks for contacting us. We will get back to you soon!RegardsNueroEdge";/*optional settings. better leave it as is for the first time*/$email_from = ''; /*From address for the emails*/$thank_you_url = 'thank-you.html';/*URL to redirect to, after successful form submission*//*This is the PHP back-end script that processes the form submission.It first validates the input and then emails the form submission.The variable $_POST contains the form submission data.*/if(!isset($_POST['submit'])){ // note that our submit button's name is 'submit' // We are checking whether submit button is pressed // This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!".print_r($_POST,true); exit;}require_once "includes/formvalidator.php";//Setup Validations$validator = new FormValidator();$validator->addValidation("fullname","req","Please fill in Name");$validator->addValidation("email","req","Please fill in Email");//Now, validate the formif(false == $validator->ValidateForm()){ echo "<B>Validation Errors:</B>"; $error_hash = $validator->GetErrors(); foreach($error_hash as $inpname => $inp_err) { echo "<p>$inpname : $inp_err</p>n"; } exit;}$visitor_email='';if(!empty($visitors_email_field)){ $visitor_email = $_POST[$visitors_email_field];}if(empty($email_from)){ $host = $_SERVER['SERVER_NAME']; $email_from ="forms@$host";}$fieldtable = '';foreach ($_POST as $field => $value){ if($field == 'submit') { continue; } if(is_array($value)) { $value = implode(", ", $value); } $fieldtable .= "$field: $valuen";}$extra_info = "User's IP Address: ".$_SERVER['REMOTE_ADDR']."n";$email_body = "You have received a new form submission. Details below:n$fieldtablen $extra_info"; $headers = "From: $email_from rn";$headers .= "Reply-To: $visitor_email rn";//Send the email!@mail(/*to*/$email_recipients, $email_subject, $email_body,$headers);//Now send an auto-response to the user who submitted the formif($enable_auto_response == true && !empty($visitor_email)){ $headers = "From: $email_from rn"; @mail(/*to*/$visitor_email, $auto_response_subj, $auto_response,$headers);}//done. if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') { //This is an ajax form. So we return success as a signal of succesful processing echo "success";}else{ //This is not an ajax form. we redirect the user to a Thank you page header('Location: '.$thank_you_url);}?> Here is the HTML: This would be the "contactus.html" <!DOCTYPE HTML><!-- Solarize by TEMPLATED templated.co @templatedco Released for free under the Creative Commons Attribution 3.0 license (templated.co/license)--><html> <head> <title>NueroEdge | Contact Us!</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <!--[if lte IE 8]><script src="css/ie/html5shiv.js"></script><![endif]--> <script src="js/jquery.min.js"></script> <script src="js/jquery.dropotron.min.js"></script> <script src="js/skel.min.js"></script> <script src="js/skel-layers.min.js"></script> <script src="js/init.js"></script> <!-- JavaScript Files --> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="js/jquery.validate.min.js"></script> <script type="text/javascript" src="js/additional-methods.min.js"></script> <script type="text/javascript" src="js/main.js"></script> <!-- End JavaScript Files --> <noscript> <link rel="stylesheet" href="css/skel.css" /> <link rel="stylesheet" href="css/style.css" /> </noscript> <!--[if lte IE 8]><link rel="stylesheet" href="css/ie/v8.css" /><![endif]--> </head> <body> <!-- Header Wrapper --> <div class="wrapper style1"> <!-- Header --> <div id="header"> <div class="container"> <!-- Logo --> <h1><a href="#" id="logo">NueroEdge</a></h1> <!-- Nav --> <nav id="nav"> <ul> <li class="active"> <a href="index.html">Home</a> <ul> <li><a href="aboutus.html">About Us</a></li> <li><a href="contactus.html">Contact Us</a></li> </li> </ul> <li><a href="left-sidebar.html">Application</a></li> <li><a href="right-sidebar.html">Leader board</a></li> <li> <a href="">Team List</a> <ul> <li><a href="no-sidebar.html">Ryan Tarson</a></li> <li><a href="no-sidebar.html">Kavin I.</a></li> </li> </ul> <li> <a href="">More...</a> <ul> <li><a href="#">Lorem ipsum dolor</a></li> <li><a href="#">Magna phasellus</a></li> <li><a href="#">Etiam dolore nisl</a></li> <li> <a href="">Phasellus consequat</a> <ul> <li><a href="#">Lorem ipsum dolor</a></li> <li><a href="#">Phasellus consequat</a></li> <li><a href="#">Magna phasellus</a></li> <li><a href="#">Etiam dolore nisl</a></li> <li><a href="#">Veroeros feugiat</a></li> </ul> </li> <li><a href="#">Veroeros feugiat</a></li> </ul> </li> </nav> </div> </div> </div> <!-- Main --> <!-- Content --> <div id="main" class="wrapper style4"> <div id="content" class="container"> <section> <header class="major"> <h2>Contact Us</h2> <span class="byline">Want to get in touch?</span> </header> <p>Welcome to the Contact us page please drop us a line with any questions you may have! This message will be reviewed and wrote back to within 24hr! Please do not send rude messages or irrelevant messages! Thank you! </p> <p>Do not use this system to reply to us! We will message back to you, if you need to reply to our message just use the open ticket and reply to our email! Thanks!</p> <div class="contact-form"> <h1>Contact Us</h1> <form id="contact-form" method="POST" action="form-to-email.php"> <div class="control-group"> <label>Your Name</label> <input class="fullname" type="text" name="fullname" /> </div> <div class="control-group"> <label>Email</label> <input class="email" type="text" name="email" /> </div> <div class="control-group"> <label>Phone (optional)</label> <input class="phone" type="text" name="phone" /> </div> <div class="control-group"> <label>Message</label> <textarea class="message" name="message"></textarea> </div> <div id="errors"></div> <div class="control-group no-margin"> <br> <input type="submit" name="submit" value="Submit" id="submit" /> </div> </form> <div id='msg_submitting'><h2>Submitting ...</h2></div> <div id='msg_submitted'><h2>Thank you !<br> The form was submitted Successfully.</h2></div> </div> </div> </div> </section> </div> <div class="wrapper style2"> <section class="container"> <div class="row double"> <div class="6u"> <header class="major"> <div class="boxA"> <br> <h2>NueroEdge YouTube <img src="images/youtubeicon.png" alt="YouTube" style="width:50px;height:35px"></h2> <span class="byline">We here at NueroEdge are a Friendly Competitive team. We have are great YouTube channel we will try our best to keep up with our weekly uploads! Click the button below!</span> <br> <a href="#" class="button">NueroEdge YT</a> </header> </div> <div class="6u"> <h3>Twitch Streaming <img src="images/twitch.png" alt="Twitch TV" style="width:50px;height:50px"></h3> <font size="5"><p>Here at NueroEdge we have our own Twitch Streaming Team! Want to watch or check out what we do? Go ahead and click the button down below!</p></font> <a href="#" class="button">Twitch Streaming</a> </div> </div> </section> </div> </div> <!-- Team --> <div class="wrapper style5"> <section id="team" class="container"> <header class="major"> <h2>Key Members/Co-Founder</h2> <span class="byline">These are the people who make it Happen! Click the Picture for twitter</span> </header> <div class="row"> <div class="3u"> <a href="#" class="image"><img src="images/ryantarson.png" alt="" style="width:162px;height:162px"></a> <h3>Ryan Tarson</h3> <p>Ryan is a Contributor, Website Developer, Social Media Admin, Account Managers, Hosting, Financial Advisor, PC Gamer/PC streamer</p> </div> <div class="3u"> <a href="#" class="image"><img src="images/kavini.png" alt="" style="width:162px;height:162px"></a> <h3>Kavin I.</h3> <p>Kavin is a Contributor, GFX Artist, Streamer, Competitive Gamer, Social Media Modarator, Account Manager</p> </div> <div class="3u"> <a href="#" class="image"><img src="images/placeholder.png" alt="" style="width:162px;height:162px"></a> <h3>Help Wanted</h3> <p>Another Develper Needed</p> </div> <div class="3u"> <a href="#" class="image"><img src="images/placeholder.png" alt="" style="width:162px;height:162px"></a> <h3>Help Wanted</h3> <p>Streamer/Competitive Player. Trust worthy</p> </div> </div> </section> </div> <!-- Footer --> <div id="footer"> <section class="container"> <header class="major"> <h2>Connect with us</h2> <span class="byline">Want to stay up to date? Follow our Social Media Networks.</span> </header> <ul class="icons"> <li class="active"><a href="https://www.facebook.com/pages/NueroEdge/1560679180842070" class="fa fa-facebook"><span>Facebook</span></a></li> <li><a href="https://twitter.com/NueroEdge" class="fa fa-twitter"><span>Twitter</span></a></li> <li><a href="#" class="fa fa-youtube-play"><span>YouTube</span></a></li> <li><a href="https://plus.google.com/111096761474269802283/about" class="fa fa-google-plus"><span>Google+</span></a></li> <li><a href="#" class="fa fa-envelope"><span>Mail></a></li> </ul> <hr /> </section> <!-- Copyright --> <div id="copyright"> ©2014 <a href="http://nueroedge.com">NueroEdge</a> All Rights Reserved | <a href="http://nueroedge.com">Contact Us |</a> <a href="http://nueroedge.com/cc0">Team Members </a> </div> </div></body></html>
  16. elcaiaimar

    CSS in form

    Hello everybody! I' ve several forms in my website but they don't show as I want. I'm using Django (python) and my form is the next: <form name="form2" action="/edicioncuenca/" method="POST"> {% csrf_token %} {{form.as_p}} <input type="submit" name="formsewer" value="Add sewer"> </input> </form> The result is a vertical form (with much space on the right side). I want to get a form in horizontal position. I mean, I would like to have a form occupying all the space. Is this possible with css? How could I do this? Thank you very much!
  17. Hi guys, I use a very big form and my variables will be saved in a session. In most cases I´m fine with PHP. Until now I just use JS to hide and show some options. My idea is to give the user a selection (somewhere in my form). As soon as the user clicks on one of the selection options, the value of the variable shall appear as text below the selection options (not just in the selection options). 1. Idea - import the php-variables in my JS and work with it <script type="text/javascript">var test ="<?php echo $test ?>";</script> --> didnt work. I could work with the variable, but I dont get a "fresh" variable from the session, because I would have to push the form button first. 2. Idea - create a JS variable in the selection options <selection id="test"><option value=test1">Test1</option><option value=test2">Test2</option>...</selection> --> didnt work. Do you have any ideas what I should look for or what I have to do? Thanks and cheers, Chrex
  18. pls help me to create php for this html form......code is below <div class="contact-info"> <div class="contact-info-left"> <h3>Feel free to contact us. Just fill the below form.</h3> <form method="post" action="send_form_email.php"> <span> <input type="text" class="name-textbox" value="Name" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Name';}"> <input type="text" class="telephone-textbox" value="Telephone" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Telephone';}"> <div class="clear"></div> </span> <input type="text" class="textbox" value="Email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Email';}"> <span> <textarea value="Message:" class="message-textbox" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Message';}">Message</textarea> <input type="submit" value="Go" class="contact-btn"> <div class="clear"></div> </span> </form>
  19. Good morning Would someone be able to guide me with some coding tips? I'm trying to post some current page info into a form on the next page. Either pass the page url, the page title, or the H3 tags through the "Enquire" & "Book now" buttons from the below php file. The fields on the form will then be hidden from view but passed through the submit button. I need help passing the info in this code below: <!--<div class="fright">--> <p class="packagebuttons"> <a class="button print" href="#" onclick="window.print();">Print</a> <!-- <a class="button thickbox" href="#TB_inline?height=500&width=700&inlineId=modalEnquire_<?php echo $node->nid; ?>&modal=true">Enquire</a> <a class="button thickbox book" href="#TB_inline?height=500&width=700&inlineId=modalEnquire_<?php echo $node->nid; ?>_book&modal=true">Book</a> --> <a class="button" href="#goto_form">Enquire</a> <a class="button book" href="#goto_form">Book</a> </p> <?php ukgirl_modal_enquire($node,'package'); ?> <?php ukgirl_modal_enquire($node,'package','book'); ?> <!--</div>--> <div class="clear"></div> Many thanks for anyones help this close to Christmas!
  20. memorabeerlia

    PHP Form-> Email not sending

    Hello, I created an order form on my website that takes the user's inputs, send confirmation emails to them and myself (order@), and then inserts the order into a mySQL database. The emails used to work, but now, for some reason, they never get sent. The email address it is supposed to be sending it to works and I have validated that nothing is getting blocked in SPAM, etc. The code for the email portion is below. I have tried debugging myself, but I get no errors on the mail() portion of the code. Any help that could be offered would be greatly appreciated. Thank you. if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "order@idrinktoremember.com"; $email_subject = "We've Got an Order!"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_POST['first_name']) || !isset($_POST['last_name']) || !isset($_POST['email']) || !isset($_POST['telephone']) || !isset($_POST['address']) || !isset($_POST['city']) || !isset($_POST['state']) || !isset($_POST['zip']) || !isset($_POST['opener']) || !isset($_POST['stain']) || !isset($_POST['memory']) || !isset($_POST['catcher'])) { died('We are sorry, but please ensure you filled in all required items. Click back to check.'); } $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // required $address = $_POST['address']; // required $city = $_POST['city']; // required $state = $_POST['state']; // required $zip = $_POST['zip']; // required $opener = $_POST['opener']; // required $stain = $_POST['stain']; // required $memory = $_POST['memory']; // required $catcher = $_POST['catcher']; // required $comments = $_POST['comments']; // not required $error_message = ""; $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/'; if(!preg_match($email_exp,$email_from)) { $error_message .= 'The Email Address you entered does not appear to be valid.<br />'; } $string_exp = "/^[A-Za-z .'-]+$/"; if(!preg_match($string_exp,$first_name)) { $error_message .= 'The First Name you entered does not appear to be valid.<br />'; } if(!preg_match($string_exp,$last_name)) { $error_message .= 'The Last Name you entered does not appear to be valid.<br />'; } if(strlen($error_message) > 0) { died($error_message); } $email_message = "Order details below.nn"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."n"; $email_message .= "Last Name: ".clean_string($last_name)."n"; $email_message .= "Email: ".clean_string($email_from)."n"; $email_message .= "Telephone: ".clean_string($telephone)."n";$email_message .= "Address: ".clean_string($address)."n";$email_message .= "City: ".clean_string($city)."n";$email_message .= "State: ".clean_string($state)."n";$email_message .= "Zip Code: ".clean_string($zip)."n";$email_message .= "Opener: ".clean_string($opener)."n";$email_message .= "Stain Selected: ".clean_string($stain)."n";$email_message .= "Memory Requested: ".clean_string($memory)."n";$email_message .= "Catcher Requested: ".clean_string($catcher)."n";$email_message .= "Comments: ".clean_string($comments)."n"; //create email headers $email_us = "order@idrinktoremember.com";$headers = "From: $email_us rn";$headers .= "Reply-To: $email_us rn";$headers .= "Return-Path: $email_usrn";$headers .= "X-Mailer: PHP rn";if(mail($email_to, $email_subject, $email_message, $headers)){ echo '';}else{ echo 'Error';}//send order confirmation email$email_subject_confirmation = "Congratulations, your order has been submitted!";$email_message_confirmation .= "The details of your order are below. Please review.nn";$email_message_confirmation .= "First Name: ".clean_string($first_name)."n"; $email_message_confirmation .= "Last Name: ".clean_string($last_name)."n"; $email_message_confirmation .= "Email: ".clean_string($email_from)."n"; $email_message_confirmation .= "Telephone: ".clean_string($telephone)."n";$email_message_confirmation .= "Address: ".clean_string($address)."n";$email_message_confirmation .= "City: ".clean_string($city)."n";$email_message_confirmation .= "State: ".clean_string($state)."n";$email_message_confirmation .= "Zip Code: ".clean_string($zip)."n";$email_message_confirmation .= "Opener Selected: ".clean_string($opener)."n";$email_message_confirmation .= "Stain Selected: ".clean_string($stain)."n";$email_message_confirmation .= "Memory Requested: ".clean_string($memory)."n";$email_message_confirmation .= "Catcher Requested: ".clean_string($catcher)."n";$email_message_confirmation .= "Comments: ".clean_string($comments)."n";$email_message_confirmation .= "nnWe will be contacting you shortly with a prototype of your design!n";$email_message_confirmation .= "nThe MemoraBEERLia Team";$headers = "From: $email_us rn";$headers .= "Reply-To: $email_us rn";$headers .= "Return-Path: $email_usrn";$headers .= "X-Mailer: PHP rn";if(mail($email_from, $email_subject_confirmation, $email_message_confirmation, $headers)){ echo '';}else{ echo 'Error';}
  21. Hi all, I have a form that works fine inn all browsers except IE. The form needs to submit on enter and use ajax to handle the fom data, Here is the relevant code. Is there anything here I can do do make it work as is with IE. What makes IE not submit with Enter and how do I get around it. Thanks <div class="element"> <b>Address</b>: <form id="addressPForm"> <input type="text" id="addressForm" value="<?php echo $address; ?>"/> <input type="text" class="uidAddress" value="<?php echo $uid; ?>" style="display:none"/> <input type="submit" id="buttonXaddress"/> </form></div> $(function() { $("#buttonXaddress").click(function(e) { e.preventDefault(); var newName = $('input#addressForm').val(); var type = "address"; if(newName != '') { var id = $('input.uidAddress').val(); $.ajax({ type: "POST", url: "changeName.php", data: {newName: newName, id: id, type: type}, success: function(result){ document.getElementById("addressP").innerHTML = result; document.getElementById("addressP").style.display="inline"; document.getElementById("addressPForm").style.display="none"; } }); } });});
  22. Hi there, I´m new at this forum and a beginner with PHP. I used the here offert "PHP - Complete Form Example" and it works fine. Thanks for that.But the submit button just proves the form and doesnt send the variables to the next page. Does anyone know a way to send the proven variables to another page? I tried: 1) Print the variable on my secound page with echo $var; --> that didnt work. I guess my secound page doesnt know where to get the variable from. I also dont know where and if my variables are saved after I press the submit button on my page. 2) Create two actions in the form like <form action="<?php echo htmlspecialchars($SERVER[...]);?>"> action=page2.php method="post"> That also didnt work. Probably because you cant use 2 actions in one form. 3) I dont want to work with url links, because you can see the variables in the url. 4) I dont want to work with sessions. 5) One of my ideas was to work with another php-script after my form, which will send my variables from the form to the secound page. I figured out how to activate the scrip, when the form is filled out correctly, but I have no idea how to send my data. How would it work with the here offert form? Thanks for your help guys.
  23. Hi, friends, this is my first time here (sorry for my english). I have rpoblem in my code and I've tryed hard to solve it unsucessfully! I hope someone can help me...The problem: The form runs almost perfectly, except for the javascript function "mostrarCampo()". It should show an "imput field" each time I check the checkbox beside it. It happens that it shows only the first input. Here is the code: [background='light grey']//-----------------function Javasscript (in a file .js)------------------//function mostrarCampo(){ var nameForm = document.forms[0].name; switch (nameForm) { case "f_Ins_Suprimento": document.f_Ins_Suprimento.sClaNome.style.visibility="visible"; document.f_Ins_Suprimento.tfSupNome.style.visibility="visible"; document.f_Ins_Suprimento.tfSupEstoque.style.visibility="visible"; break; . . . case "f_Solicitacao_2": est = document.getElementsByName("tfEst[]"); for(var i = 0; i<est.length; i++){ document.f_Solicitacao_2.tfEst[i].style.visibility="visible"; } break; default: break; }}[/background] [background='light grey']//------------------THE FORM--------------------------------------------------//<!-- FORMULARIO DINÂMICO COM TRECHOS EM PHP QUE TRAZEM DADOS PARA SEREM MANIPULADOS --><form name="f_Solicitacao_2" action="index.php" method="post"><div align="center"><table id="tabRel"> <tr> <th colspan="4">SOLICITAÇÃO DE ALOCAÇÃO DE RECURSOS</th> </tr> <tr><td colspan='2'>Equipamentos</td><td>Estoque</td><td></td></tr><?php/*RESCUING A VRIABLE */ $proId = $_REQUEST['id'];/* CAPTURANDO E TRATANDO UMA EXCEPTION*/ try {/*GETTING DATA*/$lista = Equipamento::listarEquipamento();/*FOR EACH DATA IN ARRAY LIST, GET...*/foreach($lista as $value){$equ_Id = $value['equ_Id'];$equ_Nome = $value['equ_Nome'];$equ_Est = $value['equ_Estoque'];/*WRITTING IN SCREEN A TABLE WITH FOLLOWING ROWS* IN THE FIRST ROW, THE FUNCTION 'mostrarCampo() RUNS WHEN* THE CHECKBOX IS CHECKED AND SHOULD TURN "VISIBLE" THE "INPUT"* ON NEXT ROW */echo " <tr><td colspan='2'><input type='checkbox' id='chEquName' name='chEquName[]' onclick='mostrarCampo();' value="".$equ_Id."" />".$equ_Nome."</td> <td>Estoque :<input name='tfEst[]' id='tfEst[]' type='text' size='4' style='visibility:hidden;' value="".$equ_Est."" /></td> <td><input type='hidden' name='hProId' value="".$proId."" /></td></tr>";}/* CASO A EXCEÇÃO TENHA SIDO CAPTURADA, EXEBE MENSAGEM*/} catch (N_ListaVazia $exc) {echo $exc->getMessage();}?></table> <input type='hidden' name='hLabel' value='tela_Solicitacao_2' /> <p align="center"><input type="submit" name="bSubmit" value="confirmar"/></p><p align="center"><a href="?acao=tela_Servicos">VOLTAR</a></p><p align="center"><a href="?acao=logout">SAIR</a></p></div></form>[/background]
  24. Hi, I'm new to HTML and was wondering if anyone can point me in the right direction I have a wix site and have created my own form a HTML widget The form works OK and uses Google docs to record the information and mail back to me the contents I am trying to get the form when the submit button is pressed to continue to do as before but then to open another page on my wix site The snippet of code below works OK when run in Chrome including the re-direct but fail to re-direct when in my wix widget. Any help greatly appreciated </head> <body dir="ltr" class="ss-base-body"><meta itemprop="name" content="Contact form"> <script type="text/javascript">var submitted=false;</script> <iframe name="hidden_iframe" id="hidden_iframe" style="display:none;" onload="if(submitted) {window.location='http://google.co.uk';}"></iframe> <form action="https://docs.google.com/forms/d/1wBXOs4pWPLF9BKKZslPS4-VEQIaYDkaZNYLZTpZKKIg/formResponse" method="post" target="hidden_iframe" onsubmit="submitted=true;">
  25. Hi good people of w3, I'd been using the tutorials on this site a lot in an attempt to get the email enquiry form working for the website I've been putting together for the place I'm currently employed at. This isn't exactly my forte, I'm pretty decent when it comes to html but php is an animal I'm only just starting to become familiar with.I have an issue currently where particular parts of the form are required to be filled in, and I can successfully generate errors when this does not occur. However, the errors do not actually stop the email from being sent and hence we end up with incomplete enquiries on the other side when the form is not correctly filled in.If anyone could provide some advice as to a means to make the errors stop the email from being sent, that would be much appreciated. The relevant code is below. <?php// define variables and set to empty values$nameErr = $emailErr = $partErr = $phoneErr = "";$name = $email = $part = $comments = $model = $brand = $phone = $contact_method = $product = $breakdown = "";if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["name"])) { $nameErr = "Name is required"; } else { $name = test_input($_POST["name"]); // check if name only contains letters and whitespace if (!preg_match("/^[a-zA-Z ]*$/",$name)) { $nameErr = "Only letters and white space allowed"; } } if (empty($_POST["email"])) { $emailErr = "Email is required"; } else { $email = test_input($_POST["email"]); // check if e-mail address is well-formed if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { $emailErr = "Invalid email format"; } } if (empty($_POST["phone"])) { $contact_methodErr = "Phone number is required"; } else { $phone = test_input($_POST["phone"]); } $contact_method = test_input($_POST["contact_method"]); $brand = test_input($_POST["brand"]); $product = test_input($_POST["product"]); $model = test_input($_POST["model"]); $breakdown = test_input($_POST["breakdown"]); if (empty($_POST["part"])) { $partErr = "Part number or description is required"; } else { $part = test_input($_POST["part"]); } $comments = test_input($_POST["comments"]); } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data;}// Function to validate against any email injection attemptsfunction IsInjected($str){ $injections = array('(n+)', '(r+)', '(t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; }} //Validate firstif(IsInjected($customer_email)){ echo "Bad email value!"; exit;} $email_from = 'sales@speedyspares.com';//<== update the email address $email_subject = "Online Enquiry"; $email_body = '<html><body>'; $email_body .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $email_body .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . $name = $_POST["name"] . "</td></tr>"; $email_body .= "<tr><td><strong>Email:</strong> </td><td>" . $email = $_POST["email"] . "</td></tr>"; $email_body .= "<tr><td><strong>Phone:</strong> </td><td>" . $phone = $_POST["phone"] . "</td></tr>"; $email_body .= "<tr><td><strong>Preferred Method of Contact:</strong> </td><td>" . $contact_method = $_POST[ "contact_method"] . "</td></tr>"; $email_body .= "<tr><td><strong>Brand:</strong> </td><td>" . $brand = $_POST["brand"] . "</td></tr>"; $email_body .= "<tr><td><strong>Product:</strong> </td><td>" . $product = $_POST["product"] . "</td></tr>"; $email_body .= "<tr><td><strong>Model:</strong> </td><td>" . $model = $_POST["model"] . "</td></tr>"; $email_body .= "<tr><td><strong>Breakdown Required:</strong> </td><td>" . $breakdown = $_POST["breakdown"] . "</td></tr>"; $email_body .= "<tr><td><strong>Part:</strong> </td><td>" . $part = $_POST["part"] . "</td></tr>"; $email_body .= "<tr><td><strong>Comments:</strong> </td><td>" . $comments = $_POST["comments"] . "</td></tr>"; $email_body .= "</table>"; $email_body .= "</body></html>"; $to = "sales@speedyspares.com";//<== update the email address $headers = "From: $email_from rn"; $headers .= "Reply-To: $email rn"; $headers .= "MIME-Version: 1.0rn"; $headers .= "Content-Type: text/htmlrn"; //Send the email! mail($to,$email_subject,$email_body,$headers); //done. redirect to thank-you page. header('Location: thankyou.html'); ?><form method="post" name="enquiry-form" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> <h6><strong><span class="redasterisk">*</span></strong>denotes a required field</h6> <h6>Name:<span class="error">* <?php echo $nameErr;?></span><br> <input name="name" type="text" size="50"> <br> E-mail:<span class="error">* <?php echo $emailErr;?></span><br> <input name="email" type="text" size="50"> <br> Phone:<span class="error">* <?php echo $phoneErr;?></span><br> <input name="phone" type="text" size="50"> <br /> Preferred Contact Method:<br /> <input type="radio" name="contact" value="email" /> Email <input type="radio" name="contact" value="phone" /> Phone <br /> Brand:<br> <select name="brand"> <option value="Sony">SONY</option> <option value="Sharp">SHARP</option> <option value="Hills">HILLS</option> <option value="Other">OTHER</option> </select><br /> Product:<br> <select name="product"> <option value="TV">TV/PROJECTOR</option> <option value="VIDEO">HOME VIDEO/DVD/BLU-RAY</option> <option value="AUDIO">HOME AUDIO/THEATRE SYSTEM</option> <option value="CAMERA">DIGITAL STILL CAMERA</option> <option value="CAMCORDER">VIDEO CAMERA/CAMCORDER</option> <option value="VAIO">PERSONAL COMPUTER (VAIO)</option> <option value="EREADER">eBOOK READER</option> <option value="PAUDIO">PERSONAL AUDIO</option> <option value="CAUDIO">CAR AUDIO</option> <option value="FRIDGE">REFRIDGERATOR</option> <option value="MICROWAVE">MICROWAVE</option> <option value="OTHER">OTHER</option> </select><br /> Model :<br /><em>(eg. KDL-46HX800)</em><br> <input type="text" name="model" size="50"> <br /> <input type="checkbox" name="breakdown" value="Yes" /> Request Breakdown<br /> Part number/description:<span class="error">* <?php echo $partErr;?></span><br /><em>(e.g. UWA-BR100 Wi-fi Adaptor)</em><br /> <input type="text" name="part" size="50"> <br> Comments:<br> <textarea name="comments" cols="50" rows="5">Please supply any additional information that may assist with your enquiry. (color/size/location etc.)</textarea> <br /> (Please do not use this form for submission of credit card information)</h6> <h5> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </h5> </form>
×