Jump to content

mohorter

Members
  • Posts

    6
  • Joined

  • Last visited

mohorter's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I am creating a menu with javascript and it works just fine if i keep the text as the links. But when i put in my images for the menu my dropdown for the Menus doesn't work. If you click on the image it won't do anything, but slightly below the image it shows the clickable area. Any idea on what is wrong here. Site is: http://currents-restaurant.com/form.html here is my code that i'm using <style> ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #9cb9ca; text-align: center; } li { display: inline-block; } li a, .dropbtn { display: inline-block; color: #8F090B; text-align: center; padding: px px; text-decoration: none; } li a:hover, .dropdown:hover { background-color: #5563D3; } li.dropdown { display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 150px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); } .dropdown-content a { color: black; padding: px px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover {background-color: #f1f1f1} .show {display:block;} </style> <center><ul> <li><a href="index.html"><img src="pictures/buttonhome.png" width="150" alt="Home"></a></li> <li class="dropdown"> <a href="javascript:void(0)" class="dropbtn" onclick="myFunction()"><img src="pictures/buttonmenus.png" width="150" alt="Menus"></a> <div class="dropdown-content" id="myDropdown"> <a href="breakfast.html"><img src="pictures/breakfastbutton.png" width="150" alt="Breakfast"></a> <a href="dinner.html"><img src="pictures/dinnerbutton.png" width="150" alt="Dinner"></a> <a href="lounge.html"><img src="pictures/loungebutton.png" width="150" alt="Lounge"></a> </div> <li><a href="specials.html"><img src="pictures/buttonspecials.png" width="150" alt="Specials"></a></li> <li><a href="form.html"><img src="pictures/buttonreservations.png" width="150" alt="Reservations"></a></li> <li><a href="email.html"><img src="pictures/buttonemail.png" width="150" alt="Email List"></a></li> </li> </ul></center> <script> /* When the user clicks on the button, toggle between hiding and showing the dropdown content */ function myFunction() { document.getElementById("myDropdown").classList.toggle("show"); } // Close the dropdown if the user clicks outside of it window.onclick = function(e) { if (!e.target.matches('.dropbtn')) { var dropdowns = document.getElementsByClassName("dropdown-content"); for (var d = 0; d < dropdowns.length; d++) { var openDropdown = dropdowns[d]; if (openDropdown.classList.contains('show')) { openDropdown.classList.remove('show'); } } } } </script>
  2. Thanks for all of the help. Form is working perfectly!!!
  3. Sorry, when i sent the last message i didn't wait long enough for the email. it takes our email system where i work 5 to 10 minutes to receive emails that are sent out. i must have left the office before i sent it and was impatient to wait for it. lol Anyways, everything worked and i'm going to look into the submit button a little bit more. Appreciate all of the help!!!
  4. Ok so i've updated my page with the form that i want now, but can't seem to get the update to send me the email. Ive updated the capital letters issue, but can't seem to figure out where in the php code where i have screwed up. Heres the code for the Form HTML <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form method="post" name="myemailform" action="email.php"> <p> <label for="fname">Enter First Name:</label> <input type="text" name="fname"><br> </p> <p> <label for="lname">Enter Last Name:</label> <input type="text" name="lname"><br> </p> <p> <label for="visitor_email">Enter Email:</label> <input type="text" name="visitor_email"><br> </p> <p> <label for="phonenumber">Enter Phone Number:</label> <input type="text" name="phonenumber"><br> </p> <p> Enter amount in Party: <label for="adults">Adults:</label> <input type="text" name="adults"> <label for="seniors">Seniors:</label> <input type="text" name="seniors"> <label for="kids">Kids:</label> <input type="text" name="kids"> <br></p> <label for="times">Select Prefered Time</label> <select name="times"> <option value="1 pm">1 PM</option> <option value="1:30 pm">1:30 PM</option> <option value="2 pm">2 PM</option> <option value="2:30 pm">2:30 PM</option> <option value="3 pm">3 PM</option> <option value="3:30 pm">3:30 PM</option> <option value="4 pm">4 PM</option> <option value="4:30 pm">4:30 PM</option> <option value="5 pm">5 PM</option> <option value="5:30 pm">5:30 PM</option> </select> <br> <br> <label for="message">Special Requests:</label><br> <textarea name="message" rows="10" cols="30">Insert request here</textarea> <br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form> </body> </html> Heres the code for my PHP file <?php if (!isset($_POST["submit"])) { echo "error; you need to submit the form!"; } $fname = $_POST["fname"]; $lname = $_POST["lname"]; $visitor_email = $_POST["visitor_email"]; $phonenumber = $_POST["phonenumber"]; $adults = $_POST["adults"]; $seniors = $_POST["seniors"]; $kids = $_POST["kids"]; $times = $_POST["times"]; $message = $_POST["message"]; if(empty($lname)||empty($visitor_email)) { echo "Name and email are mandatory!"; exit; } $email_from = "adam@radisson.com"; $email_subject ="New Form Submission From $lname \n"; $email_body ="You have received a new message from $fname $lname \n". "Email Address: $visitor_email \n". "Phone Number: $phonenumber \n". "Amount in Party: $adults $seniors $kids \n". "Here is the time requested: $times \n". "Special Requests are: $message \n"; $to = "adam@radisson.com"; $headers = "from: $email_from \r\n"; mail ($to, $email_subject, $email_body, $headers); ?> Thanks again
  5. I am trying to create a form with PHP to send the data to my email, but can't quite get it to work. I have been successful on the php code to send me an email on the data that is supposed to come trough but all it sends is the description of the form fields. Was wondering if anyone out there can help me in where I have messed up, or what I am missing in my code. This is just a shell of what i want to do, but want to try to get it to work before i make it more advanced. HTML Form <!doctype html> <html> <head> <meta charset="utf-8"> <title>Untitled Document</title> </head> <body> <form method="post" name="myemailform" action="email.php"> <p> <label for="name">Enter Name</label><br> <input type="text" name="name"><br> </p> <br> <p> <label for="visitor_email">Enter Email</label><br> <input type="text" name="visitor_email"><br> </p> <label for="times">Enter Times</label><br> <select name="times"> <option value="3 pm">3 PM</option> <option value="4 pm">4 PM</option> </select> <label for="message">Enter Message</label><br> <textarea name="message" rows="10" cols="30">Insert comments here</textarea> <br> <input type="submit" value="Submit"> <input type="reset" value="Reset"> </form> </body> </html> PHP code <?php if (!isset($_POST["submit"])) { echo "error; you need to submit the form!"; } $name = $_post["name"]; $visitor_email = $_post["visitor_email"]; $times = $_post["times"]; $message = $_post["message"]; if(empty($name)||empty($visitor_email)) { echo "Name and email are mandatory!"; exit; } $email_from = "adam@email.com"; $email_subject ="New Form Submission"; $email_body ="You have received a new message from $name \n". "email address: $visitor_email \n". "Here is the message: $message \n". "Here is the time: $times \n". $to = "adam@email.com"; $headers = "from: $email_from \r\n"; mail ($to, $email_subject, $email_body, $headers); ?> Thanks in advance Adam
×
×
  • Create New...