Jump to content

Search the Community

Showing results for tags 'forms'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


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


  • Community Calendar




Website URL








Found 43 results

  1. Hello everyone, I am trying to make my first website and have been going through some javascript examples on W3S to learn how to make a website more interactive. I have been looking at the code for modal login and signup forms found here: https://www.w3schools.com/howto/howto_css_login_form.asp and here: https://www.w3schools.com/howto/howto_css_signup_form.asp The HTML and CSS are easy enough to understand I think, but I seem to be having some trouble with the JS aspect of the tutorials. What I have done is simply add both forms to an HTML document, linked to the styling and that seems to be working fine. The problem is when I click outside of the form the display for the modal forms should be set to none by the javascript code but this only works for one button. I have been able to rearrange some of the code so the second button works but then the first button wouldn't work. I have the code listed below. I've been trying this for a few days and would really like some help. Thanks in advance. HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Website3</title> <link rel="stylesheet" href="reset.css"> <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="login.css"> </head> <body> <div id="outerMain"> <div id="main"> <header> <button onclick="document.getElementById('id01').style.display='block'" style="width:auto;">Login</button> <button onclick="document.getElementById('id02').style.display='block'" style="width:auto;">Sign Up</button> <div id="id01" class="modal"> <form class="modal-content animate" action="/action_page.php"> <div class="imgcontainer"> <span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close Modal">&times;</span> <img src="logo.png" alt="Avatar" class="avatar"> </div> <div class="container"> <label><b>Username</b></label> <input type="text" placeholder="Enter Username" name="uname" required> <label><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <button type="submit">Login</button> <input type="checkbox" checked="checked"> Remember me </div> <div class="container" style="background-color:#f1f1f1"> <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">Cancel</button> <span class="psw">Forgot <a href="#">password?</a></span> </div> </form> </div> <div id="id02" class="modal"> <form class="modal-content animate" action="/action_page.php"> <div class="imgcontainer"> <span onclick="document.getElementById('id02').style.display='none'" class="close" title="Close Modal">&times;</span> </div> <div class="container"> <label><b>Email</b></label> <input type="text" placeholder="Enter Email" name="email" required> <label><b>Password</b></label> <input type="password" placeholder="Enter Password" name="psw" required> <label><b>Repeat Password</b></label> <input type="password" placeholder="Repeat Password" name="psw-repeat" required> <input type="checkbox" checked="checked"> Remember me <p>By creating an account you agree to our <a href="#">Terms & Privacy</a>.</p> <div class="clearfix"> <button type="button" onclick="document.getElementById('id02').style.display='none'" class="cancelbtn">Cancel</button> <button type="submit" class="signupbtn">Sign Up</button> </div> </div> </form> </div> <script src="scripts.js"> </script> </header> <section> <center><img src="centerimg.png" alt=""></center> </section> </div> </div> <footer> <center>HERE IS THE FOOTER!!</center> </footer> </body> </html> Javascript: var login = document.getElementById('id01'); var modal = document.getElementById('id02'); console.log(login); console.log(modal); if(login == document.getElementById('id01')){ console.log(login); window.onclick = function(event) { if (event.target == login) { login.style.display = "none"; } }; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } }; CSS: html,body{ height: 100%; } #outerMain { min-height: 100%; } #main{ overflow: auto; padding-bottom: 100px; background-color: green; } header{ background-color: blue; } /* Full-width input fields */ input[type=text], input[type=password] { width: 100%; padding: 12px 20px; margin: 8px 0; display: inline-block; border: 1px solid #ccc; box-sizing: border-box; } /* Set a style for all buttons */ button { background-color: #4CAF50; color: white; padding: 14px 20px; margin: 8px 0; border: none; cursor: pointer; width: 100%; } button:hover { opacity: 0.8; } /* Extra styles for the cancel button */ .cancelbtn { width: auto; padding: 10px 18px; background-color: #f44336; } /* Center the image and position the close button */ .imgcontainer { text-align: center; margin: 24px 0 12px 0; position: relative; } img.avatar { width: 40%; border-radius: 50%; } .container { padding: 16px; } span.psw { float: right; padding-top: 16px; } /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ padding-top: 60px; } /* Modal Content/Box */ .modal-content { background-color: #fefefe; margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */ border: 1px solid #888; width: 80%; /* Could be more or less, depending on screen size */ } /* The Close Button (x) */ .close { position: absolute; right: 25px; top: 0; color: #000; font-size: 35px; font-weight: bold; } .close:hover, .close:focus { color: red; cursor: pointer; } /* Add Zoom Animation */ .animate { -webkit-animation: animatezoom 0.6s; animation: animatezoom 0.6s } @-webkit-keyframes animatezoom { from {-webkit-transform: scale(0)} to {-webkit-transform: scale(1)} } @keyframes animatezoom { from {transform: scale(0)} to {transform: scale(1)} } /* Change styles for span and cancel button on extra small screens */ @media screen and (max-width: 300px) { span.psw { display: block; float: none; } .cancelbtn { width: 100%; } }
  2. The FORM Attribute

    QUESTION ONE: When using the form attribute with a non-form element to redirect the contents of the non-form element to the form element, will confusion be created, if the non-form element is included in a form element different from the form element that contains the type='submit' input element? QUESTION TWO: Are fieldset elements an exception in this regard? Or, are they, too, treated as non-form elements.
  3. After letting a project age well, I'm looking at modernizing my code. The project takes the data input all year long at several different events and builds a 'league scoreboard' of them. The code goes back as far as 2002 in the oldest parts and the last major update to the code was in '07 even if CSS was added by someone else in '14. I have not worked with CSS before, and had a helper apply it to the PHP pages I coded way back when, but they were using a HTML4 subset that I would consider 'less than easily human readable'. My helper dropped out and I found myself looking at W3.css to learn what about what had changed in the ten years or so since I worked actively on this codebase, in order to pick up what they had started and migrate to something that I could maintain alongside my code. It was also decided to try and code parts of the project specifically for mobile use first. (/backstory) After playing around with W3.css I came up with a HTML template of what I'd like to get working. http://scaikeqc.org/sandbox/tf-03.html. It needs polishing, and some refinements, but its close to what I want for the mobile experience. Please note, there are no FORM tags in that page so the selects and inputs are for show only. I tried making a proper form of it, http://scaikeqc.org/sandbox/tf-03.php and it was a right mess. Every time you click on the accordion labels to expand them, the form submits, the script reloads, hilarity ensues. This introduces trash into the resultset and before I remembered to use the action tag on the form element, I crashed the GET. Is it possible to have a whole-page form broken into accordion segments? Here is a snip of the-03.php <form class="w3-form" method="post" action="<?php echo $_SERVER[PHP_SELF]?>"> <div class="w3-accordion w3-light-grey"> <button onclick="feif('Rider')" class="w3-btn-block w3-centered"> Open Rider Selection </button> <div id="Rider" class="w3-accordion-content w3-container w3-red"> <H2>Select the Rider</H2> <SELECT class="w3-select" NAME="Pname"> <?PHP IF (isset($Pname)){ printf("<OPTION VALUE=\"%s\">RiderID: %s\n", $Pname, $Pname); } else { echo "<OPTION VALUE=\"XXX\">Select Rider<OPTION VALUE=\"XXX\">-----\n"; echo "<OPTION VALUE=\"NEW\">**NEW RIDER**\n"; } ?> <OPTION VALUE="XXX">----- <OPTION VALUE="306">Johanna <OPTION VALUE="83">Aaron MacGregor <!-- 465 additional select items omitted for brevity--> <OPTION VALUE="421">Zinaida Orshima <OPTION VALUE="114">Zuriel Nightshade <OPTION VALUE="XXX">-----<OPTION VALUE="NEW">**NEW RIDER** </SELECT> </div> <button onclick="feif('Horse')" class="w3-btn-block w3-centered"> Open Horse Selection </button> <div id="Horse" class="w3-accordion-content w3-container w3-red"> <H2>Select the Horse</H2> <SELECT class="w3-select" NAME="Hname"> <?PHP IF (isset($Hname)){ printf("<OPTION VALUE=\"%s\">HorseID:%s\n", $Hname, $Hname); } else { echo "<OPTION VALUE=\"XXX\">Select Horse<OPTION VALUE=\"XXX\">-----\n"; echo "<OPTION VALUE=\"NEW\">**NEW Horse**\n"; } ?> <OPTION VALUE="12">Unknown Mount <OPTION VALUE="XXX">----- <OPTION VALUE="103">Ace <!-- 380 additional select items omitted for brevity--> <OPTION VALUE="236">Zeus' Dream <OPTION VALUE="280">Zia <OPTION VALUE="XXX">-----<OPTION VALUE="NEW">**NEW HORSE** </SELECT> </div> The form continues through five more containers I've not copied here. <input type="submit"> </FORM> <script> function feif(id) { var x = document.getElementById(id); if (x.className.indexOf("w3-show") == -1) { x.className += " w3-show"; } else { x.className = x.className.replace(" w3-show", ""); } } </script> I have a proof-of-concept form that does work(no accordions or data validation, data entered is not retained). This one checks an events database to see which of the five games are being played and only displays the data entry containers for the games that are being run. This is why I wanted to containerize the different sections of data entry. You can poke at that form here http://scaikeqc.org/sandbox/tf-05.php. If you've gotten this far in my post, please accept my thanks for seeing it through, and my apologies for less than beautified code. I'm recycling a lot of the form code from the previous version and haven't had the time to polish non-working code.
  4. Hello. I've created a small form with 6 text boxes and 2 select boxes/fields. The problem I'm facing is that I'm unable to post from the form to another php file. In the html form, I've written:- <form action="newmember.php" method="POST"> <table> <tr> <td>Full Name / Business Name:</td> <td><input name="txtAccountName" size="20" maxlength="50"></td> <td></td> </tr> <tr> <td>Username:</td> <td><input name="txtUsername" size="20" maxlength="50"></td> <td></td> </tr> <tr> <td>EMail:</td> <td><input name="txtEmail" size="20" maxlength="100"></td> <td></td> </tr> <tr> <td>Password:</td> <td><input name="txtPassword" type="password" size="20" maxlength="20"></td> <td></td> </tr> <tr> <td>Confirm Password:</td> <td><input name="txtConfirm_Password" type="password" size="20"></td> <td></td> </tr> <tr> <td>DOB:</td> <td><input name="txtdob" size="12" value="dd/mm/yyyy" maxlength="12"></td> <td></td> </tr> <tr> <td>Membership Type:</td> <td><select name="comMembership" size="1"> <option selected="selected">Individual</option> <option>Business</option> </select> </td> <td></td> </tr> <tr><td></td></tr> <tr> <td>You Agree to our<br> Terms and Conditions,<br> and Privacy/Cookies Notice.</td> <td><select name="txtAgree" size="1"> <option selected="selected">N</option> <option>Y</option> </select> </td> </tr> </table> <input name="submit" type="image" src="/mainimages/submit.jpg" style="border: 0" alt=""> </form> And in the newmember.php file I've so far written:- <?php // Check Entries $New_Agree = $_POST["txtAgree"]; $New_Fullname = $_POST["txtAccountName"]; $New_Username = $_POST["txtUsername"]; $New_EMail = $_POST["txtEmail"]; $New_Password = $_POST["txtPassword"]; $New_Confirm_Password = $_POST["txtConfirm_Password"]; $New_Dob = $_POST["txtdob"]; $New_Membership = $_POST["comMembership"]; ?> I'd just like to ask:- 1. Dose my coding look correct, as I've not been faced with posting problem before? 2. Should I place the $_POST in html instead of php? 3. Oh yes, I've found that the DOB is posted ok, however I've placed value="dd/mm/yyyy" as a temporary measure only. I'd be grateful for any ideas or guidance/help. Thank You very much.
  5. HTML forms help

    Hi, I am still a rookie when it comes to HTML and would like to create a form that has a single input field. I would like it to show a password field but whatever you type in it would add the html file extension to it and take you to that page. Example, Say you type monkey then click submit. It would take you to monkey.html which is a webpage within my website. Please help... I keep trying stuff and I am getting more confused the more I try it. Thank you Jesse
  6. Hi I have been putting in forms post in websites for a long time just started in the last few weeks to have a go at mobile website building using 3 of the w3c templates. which are terrific but one don't want to play. Its the form post I looked and tried many different ways to make the form work but its split with a div in removing the div the post works fine and looks good on website but not on mobile. I have put in a block form without the div of a different design post box which validates html4 but does not look as good, I want to keep the original post form in. Put the website through html tidy up which takes the <form/> and moves it to just after the action post. It validates to html4 but the form does not post.below is the offending scrip. <form action="mail99.php" method="POST"> <input type="text" value="Name" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Name';}"> <div class="clear"> </div> </div> <div class="your-single"> <i class="email"> </i> <input type="text" value="E-mail" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'E-mail';}"> <div class="clear"> </div> </div> <div class="your-single"> <i class="website"> </i> <input type="text" value="Website" onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Website';}"> <div class="clear"> </div> </div> </div> <div class="grid-single-in"> <textarea name="message" cols="77" rows="5" value=" " onfocus="this.value='';" onblur="if (this.value == '') {this.value = 'Message';}">Message</textarea> <input type="submit" value="SENT MESSAGE"> </form> I put one form block in which worked fine but it totally alters the shape on mobile view. Would be pleased if any one could solve this problem keeping the div in place and being validated to HTML4/5 Thank you for your time a picture below
  7. Pass on text in forms

    I'm not very experienced in html. Is there a way to pass on text that is shown as a part of a form (not text that the user fill in, but text written by the programmer in the html-file), without having to write it as "value" in addition? I've checked the W3Schools.com, and tried to search google as well, but I can't find any information on this. I know I can do something like this: <td>Verb1<input type="hidden" name="Verb1" value="Verb1"></td> But is there a way of doing this without having to write the same twice in the html-coding?
  8. Hello; This is the first time I have posted to this forum. I have been developing javascript and php in web related context for some time. But there is always some detail that gets solved at some point, but solution is buried in old code somewhere. I am currently trying to get javascript to set a hidden field from the selection a user makes from a set of radio buttons. I have googled around and found some reference an a clue in "current value" but that won't fly in javascript, and the actual syntax was not provided...... SO: here is some code var closeSAOOpt = function() { var opt = document.forms.script.openOpt.currentValue alert(opt) } alert in code above produces "undefined". I know one of the radios is checked. I have varified that openOpt is in fact the radio group name and that it is assigned to both radio button name values. I know the document.forms.script is defined, and that javascript won't accept spaces in variable names. So I have assumed 'current value' is currentValue in javascrip But what "undefined" is referring to is often not obvious. The funtion above is called in an eventlistener attached to a button element labeled "Done" Can I get a hand with this from someone? Thank you for time and attention.
  9. Hi, I wonder why echo is needed in the following lite of code (for a safe form submission)? I have searched for an answer but everyone seems to discuss the htmlspecialchar thing, but noone explains the "echo". <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>"> When I use this piece of code it results in a zero printed out on my website... Thanks a lot!
  10. Linking an email address into a custom form

    Hello again! The last thing I am attempting to do for my 1st website is add a custom form that I made via https://coveloping.com/tools/html5-responsive-form-generator I was able to figure out how to get it to appear on my page however I didn't see an option in the builder to select which email the form should send to. I am assuming this will go into the HTML section and not the CSS section? +54 Karma points if you can assist me x) May The 4th Be With You.
  11. Hello, Im a bit lost with this project, I cant seem to find the problem and I sure could use an extra set of eyes to look it over. when the form is submitted it comes back to the error page and the emails are not sent. any ideas? Thanks in advance! <?phpfunction ValidateEmail($email){ $pattern = '/^([0-9a-z]([-.w]*[0-9a-z])*@(([0-9a-z])+([-w]*[0-9a-z])*.)+[a-z]{2,6})$/i'; return preg_match($pattern, $email);}if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'form344'){ $mailto = $_POST['unit'];if(isset($_POST['unit'])) { $units['M17'][] = 'email@email.com, email@email.com'; $units['M16'][] = 'email@email.com'; $to = implode(",",$units[$_POST['unit']]); $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto; $subject = 'Transfer'; $message = ''; $success_url = './success.php'; $error_url = './error.php'; $error = ''; $eol = "n"; $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000; $boundary = md5(uniqid(time())); $header = 'From: '.$mailfrom.$eol; $header .= 'Reply-To: '.$mailfrom.$eol; $header .= 'MIME-Version: 1.0'.$eol; $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol; $header .= 'X-Mailer: PHP v'.phpversion().$eol; if (!ValidateEmail($mailfrom)) { $error .= "The specified email address is invalid!n<br>"; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field"); $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (!is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol; if ($mailto != '') { mail($mailto, $subject, $body, $header); }mail($mailto, $subject, $body, $header); header('Location: '.$success_url); exit;}}if (session_id() == ""){ session_start();}if (!isset($_SESSION['username'])){ header('Location: ./notloggedin.php'); exit;}if (isset($_SESSION['expires_by'])){ $expires_by = intval($_SESSION['expires_by']); if (time() < $expires_by) { $_SESSION['expires_by'] = time() + intval($_SESSION['expires_timeout']); } else { unset($_SESSION['username']); unset($_SESSION['expires_by']); unset($_SESSION['expires_timeout']); header('Location: ./notloggedin.php'); exit; }}if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['formid'] == 'form1'){ $mailto = $_POST['unit'];if(isset($_POST['unit'])) { $units['M17'][] = 'email@email.com, email@email.com'; $units['M16'][] = 'email@email.com'; $to = implode(",",$units[$_POST['unit']]); $mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto; $subject = '911'; $message = ''; $success_url = './success.php'; $error_url = './error.php'; $error = ''; $eol = "n"; $max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000; $boundary = md5(uniqid(time())); $header = 'From: '.$mailfrom.$eol; $header .= 'Reply-To: '.$mailfrom.$eol; $header .= 'MIME-Version: 1.0'.$eol; $header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol; $header .= 'X-Mailer: PHP v'.phpversion().$eol; if (!ValidateEmail($mailfrom)) { $error .= "The specified email address is invalid!n<br>"; } if (!empty($error)) { $errorcode = file_get_contents($error_url); $replace = "##error##"; $errorcode = str_replace($replace, $error, $errorcode); echo $errorcode; exit; } $internalfields = array ("submit", "reset", "send", "filesize", "formid", "captcha_code", "recaptcha_challenge_field", "recaptcha_response_field"); $message .= $eol; foreach ($_POST as $key => $value) { if (!in_array(strtolower($key), $internalfields)) { if (!is_array($value)) { $message .= ucwords(str_replace("_", " ", $key)) . " : " . $value . $eol; } else { $message .= ucwords(str_replace("_", " ", $key)) . " : " . implode(",", $value) . $eol; } } } $body = 'This is a multi-part message in MIME format.'.$eol.$eol; $body .= '--'.$boundary.$eol; $body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol; $body .= 'Content-Transfer-Encoding: 8bit'.$eol; $body .= $eol.stripslashes($message).$eol; if (!empty($_FILES)) { foreach ($_FILES as $key => $value) { if ($_FILES[$key]['error'] == 0 && $_FILES[$key]['size'] <= $max_filesize) { $body .= '--'.$boundary.$eol; $body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol; $body .= 'Content-Transfer-Encoding: base64'.$eol; $body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol; $body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol; } } } $body .= '--'.$boundary.'--'.$eol;}}?>
  12. .php function not working

    <button onclick="myfunction()">Submit</button><?phpfunction myfunction(){ golbal $qual; if (document.getElementById('nota1').checked) { $qual++}; if (document.getElementById('nota2').checked) { $qual++}; if (document.getElementById('nota3').checked) { $qual++; echo "Your score is: $qual out of 30"}; else {echo "First check the answers you think correct"};}?> I don't understand why this php snippet (which i have included in a html with a form in it) is wrong. When i click "Submit" button nothing happens.
  13. I am trying to build a rather large (16+ pages, 2,000+ fields) Survey form to use as part of my Inspection business. I kept being told "it can't be done" and being an old school hack, I thought it could be done... So I wrote a smaller "Proof of Concept" form that has most of the features I wanted... I used Abobe Acrobat XI and Javascript and LOTS of Google searches The form works...(Very well thank you) So now I want to find someone to re-write it (for Pay) nicely for real.... I have posted it on "eLance" but would like to know where else I could post it to find people interested in working on a really Nasty, large, complicated, Acrobat PFD Form with some interesting Javascript as well? Yes, I could do it, but that is not what I am good at... I am a Proof kind of Guy.... I show that it -can- be done, and then turn over the detail to someone who is detail oriented. (and writes neater code than I do) Be happy to post the Sample Form and the RFP here (if I can) so long as its understood that I know I am a hack, and it was PURELY a proof-of-concept exercise. The code is ugly, complicated, but it works... PS.. this forum was instrumental in figuring out how to do some of the "impossible" things...
  14. Form processing in a separate file

    Is there a way to use a separate file for form processing if I want the results to appear on the same page, right below the form? Or do I have to leave all my PHP code in the page itself?
  15. Hi, I've just built a basic web site, but I now realise (by going through the process) that I need to understand other languages & processes in order to make the site streamlined & fully functional. Because I've only learnt html & css (on a basic level) my understanding of php, sql, js, xml, etc is very poor. I therefor need some advice on what the best mechanisms are for inputting data, storing it & displaying it on the web, possibly with some type of rss feed too. The basic process the site is doing, can be described as follows: 1. Users enter data using an online form. 2. Data is stored on a database & manually verified. 3. Certain info from the database is automatically displayed on the site (but not all) in a friendly viewable format. 4. Every time the site is updated a feed is created (like an rss or blog). The first two processes I have achieved, but I am exploring ways of achieving the 3rd & 4th processes. Any advice on what methods or languages would be best to use would be greatly appreciated. I'm happy to learn any coding required. The data set can be stored in various formats (xlsx, csv, ods, tsv, etc), its really a question of the best way to interpret it & automatically display it that I am exploring. Along with creating the feed. Thanks for any advice. Old Guy.
  16. Hello, MyProject I am having a hard time making the form inputs align with the localstorage table. The forms will have to fit in between the ID and ACTIONS columns and align with where the data is being inputted. I also am having a hard time setting the widths for the table columns. Adjusting the padding is not a problem, but setting a set width is a problem. Any help would be greatly appreciated. Also, is there any way to change the local storage ID something like GW-"DATE"-"TIME" rather than numerically going up 1-2-3-4-5-etc.? Thank you, I SIDEARM I

    I have a website I created by using WIX. I am trying to Create a Form for First Name, Last Name and E-mail address that I would like to Pass the First Name, Last Name and E-mail on to a URL: The URL http://www.mb103.com/lnk.asp?o=6189&c=71590&a=120164&s1=fname&s2=lname&s3=emaill/ The S1, S2 & S3 are sub ID fields. My Question is how do I get the s1, s2, & s3 data after hitting the submit button to be inserted in the url above. <!DOCTYPE html><html><body> <form method="get" action="http://www.mb103.com/lnk.asp?o=6189&c=71590&a=120164&s1=email&s2=email/">First Name: <input type="text" name="fname"><br><br>Last Name: <input type="text" name="lname"><br><br>E-mail: <input type="text" name="email"><br><br><input type="submit" value="Submit"></form> </body></html> Thanks.
  18. Hello internet, I was not sure if I should put this in JAVASCRIPT or php – in the end the form gets submitted so I decided to put this in the PHP forum. Here is my dilemma – I have several JAVASCRIPT checks to make sure people fill out their name, phone number, feedback content, and have a valid email address. On occasion it seems like people are getting around that JAVASCRIPT just to prove a point. Blank forms are being submitted. What can I do to prevent this?
  19. form data becomes URL

    How can I create a form which creates a URL out of the input data (and goes to the page)? My aim is to create a spelling helper. The user will hear an audio file of one of the 100 most misspelled words. They will type it into the field, and click the "CHECK SPELLING" button. If they spelled it correctly they will be sent to that page. If not, it will go to a "Try again!" page, or at least that message will pop up on the current page. EXAMPLE: They hear the word "ACCOMMODATE", type it in and click "CHECK SPELLING". If correctly spelled, the ACCOMMODATE.HTML will appear. If not correct they will get a "Try again!" message or be sent to a "Try again!" page. I can imagine an even slicker UI, in that the correct spelling simply gets a "Good job!" message, and the incorrect spelling is messaged with "Try again!". (Fewer pages to create.) I looked around for such code, but could not find it. Thanks for your help!
  20. Comments Form

    Good afternoon everyone, I created a website for a friend www.bristol1775.co.uk of which there are several pages. What I would like is under each poster/flyer embed a comments form, so attendees can leave comments / feedback on what they thought of the night. Could anyone assist with the HTML code. I have tested the basic form comments where it goes to email, but I just want a basic leave a comment form. Kind regards Gary
  21. Help with complex form creation

    I am not sure if I am in the right spot with this question but I can't seem to find what I need anywhere.I want to create an online order/pricing form.I really like this format http://theaerialistpress.com/content/house-pricing but no matter where I search on HTML forms or JavaScript or PHP, I can't see how the + and - lines are implemented. I realise I could pay someone to do this for me, but a) I have no money and for now it's just for me so I want to learn how to do it.If anyone can point me in the right direction for what to learn or what to look for would be awesome.Thanks in advance.
  22. I have been having a terrible time with my forms. They line up perfectly in IE, but are all helter-skelter in both Chrome and Firefox. No matter what I do, I can't get them to line up properly in the latter two. One of the problems, is that the label for the text input is always above the input box in Firefox and Chrome, whereas it is to the left of the input box in IE. There doesn't seem to be any formatting that I can do to force this one way or another. Please help if anyone can.
  23. I was not sure whether this question belongs here of in the PHP forum since my problem may be with one or the other or both. I use the following html and php code to select and upload multiple files.HTML <form action="uploadFiles.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file[]" multiple="multiple"/></br> <input type="submit" name="submit[]" value="submit" /> </form> uploadFiles.php <?php if(isset($_POST['submit'])) { if ($_FILES["file[]"]["error"] > 0) { echo "Error: " . $_FILES["file[]"]["error"] . "<br>"; } else { $numFilesUploaded=count($_FILES['file']['name']); echo "No. files uploaded : ".$numFilesUploaded."<br><br>"; for ($inc=0; $inc<$numFilesUploaded; ++$inc){ echo "File " . $inc . ": " . $_FILES["file"]["name"][$inc] . "<br>"; echo "Upload: " . $_FILES["file"]["name"][$inc] . "<br>"; echo "Type: " . $_FILES["file"]["type"][$inc] . "<br>"; echo "Size: " . ($_FILES["file"]["size"][$inc] / 1024) . " kB<br>"; echo "Stored in: " . $_FILES["file"]["tmp_name"][$inc]; echo "<br><br>"; } } } ?> If I select 2 files, each having names of character length 8, the code works fine. However, when I select files with names of character length 32, $_POST is an empty array. What is the best way to upload multiple files where the file names may be long? I ran phpinfo() and it did indeed say "This server is protected with the Suhosin Patch 0.9.10 ..." Some people have suggested that it may be a problem with the file size. However, I never get to even try to upload files since the names are not properly passed to the PHP code if the filenames are too long. Also, I have modified /etc/php5/apache2/php.ini to allow the upload of files larger than the files I am trying to upload. Also, I do not have this problem if I shorten the names of the files I am having trouble with. Many thanks in advance for any help.
  24. CSS to edit forms

    Hello All, I work in the marketing department and have recently taken over editing the website. I hadn't been website designing since the days of static html pages and notepad, so it's been a bit. I've been picking up Php and CSS fairly well but have reached quite the irritating point - using css to theme forms (input boxes and whatnot). The form in qestion is found on http://www.mercurymosaics.com/ It's at the bottom of the page to subscribe to our mailing list. As you see it's large and bulky. I've edited the button to look less nasty, but cannot for the life of me figure out how to take what I designed and actually code it. I've been doing a lot of reading but this darn thing is driving me crazy. Here's a basic idea of what I want it to look like. https://www.dropbox.com/s/jvvwn20x2afjjqf/MailingSubmit.png I know where to put the code I believe but the actual coding iteself between .'s and #'s and blah blah - yeah not so much. Thanks bunches for your help. -Heather
  25. Form with multiple actions

    Not sure if this has been asked before. I did a search but couldn't find it. If this does end up being a duplicate thread, my bad. So I have this form, and what it does is it takes the information that the user inputs and sends it via email to us using a PHP script when submit is clicked. The information is sent to us in a certain way that fits into our client relationship manager nicely. But what the script does is another story. I'm concerned about the HTML. Looks kinda like this. <form action="email.php" class="container" id="mail" method="post" enctype="multipart/form-data" language="JavaScript" name="FrontPage_Form2"><li></li><label>Title</label><select id="title" name="title" tabindex="3"><option value="">Select</option><option value="">Mr.</option><option value="">Ms.</option><option value="">Mrs.</option></select><input name="Submit" class="submit" tabindex="16" type="submit" value="Submit" /> Etc. What I want to know is how to, if possible, have the form set up so that it executes a different script if the user clicks a checkbox. Like <form action="email.php" class="container" id="mail" method="post" enctype="multipart/form-data" language="JavaScript" name="FrontPage_Form2"><li></li><label>Title</label><select id="title" name="title" tabindex="3"><option value="">Select</option><option value="">Mr.</option><option value="">Ms.</option><option value="">Mrs.</option></select><li></li><label>Have the email sent directly to sales</label><input name="checkbox" tabindex="17" type="checkbox"><input name="Submit" class="submit" tabindex="16" type="submit" value="Submit" /> So when that checkbox is clicked, instead of executing email.php, it executes another script instead that sends a different message to a different person. If that makes any sense. If you want the real code, I can give it to you, it's just a lot longer and I don't see it as necessary to illustrate my point. If anyone knows how to achieve this, or has any ideas, I will implement them immediately, and pledge undying loyalty to said user.