HTML - Input Codes Wont Do Their Job In Form. (required_fields Etc)
Similar TutorialsHi I'm new around here and new to html as well so pardon me if I posted this under the wrong section. I currently have a navigation bar using the following codes to swap innerHTML within the page. Code: <span class="navs" onMouseover="this.style.background='#666666'" onMouseout="this.style.background='#000000'" onClick="document.getElementById('main').innerHTML=document.getElementById('About Us').innerHTML"><center>About Us</center></span> And Code: <script> function changeNavigation(id) {document.getElementById('main') .innerHTML=document.getElementById(id).innerHTML} </script> Which gets me to Code: <div id="About Us" style="display:none"> Stuff about IAS </div> I now want to make a menu at the bottom of the page to quickly jump to other pages since the navigation bar is at the top. Therefore I am using the form code as such Code: <form name="selecter" id="selecter" action=""> <select name="select1" id="select1" size="1"> <option value="none"> Quick Jump <option onClick="document.getElementById('main').innerHTML=document.getElementById('About Us').innerHTML"> About Us</option> </select> </form> However, when I select the option "About Us" in the menu, nothing happens. Could someone explain to me why nothing happens and perhaps provide a solution? Thanks in advance. Hey there, I registered in hope of getting some help I'm creating this bulletin board in our intranet and I really need to add couple of buttons which would help our users with posting their stuff. The board obviously understands HTML and this is what I want to do: I need to have a button that adds html tags into the textfield when clicked. For example if I wanted to add <br> in the post, I just would have to press a button to do it. Hope you understand what I mean and hope you can help me, I'm such a newbie when it comes to this Cheers! This is a problem that i driving me crazy. I have this forms on my website that people can use to post comments. They have one textarea that they should write their name in and another that they should write their comment. I try to make the default text "Namn" and "Kommentar", but only "Namn" is showing in firefox. The weird thing is though, that if I change places between the two textareas, both are showing fine. I provide the site with the source code, and for a quicker check, the code for the two textareas. <textarea name="db_comment_namn" type="text" value="Namn" rows="1" cols="15" style="font-size: xx-small; font-family: Verdana; font-weight: Bold; font-style: Italic; border: 1px inset #CCCCCC; padding: 1px;">Namn</textarea> <textarea name="db_comment_kommentar" type="text" value="Kommentar" rows="1" cols="50" style="font-size: xx-small; font-family: Verdana; font-weight: Bold; font-style: Italic; border: 1px inset #CCCCCC; padding: 1px;">Kommentar</textarea> http://foto.jaxell.se Thanks in advance. HTML Code: <div class="contactlistdiv"> <select multiple="yes" name="send" class="contactlistone" size="6"> <option value="1" >hello</option><option value="2" >gee</option><option value="3" >gluba</option></select> </div> I am creating a list like the one above. When I style it with CSS it wont let me select any options! E.g if i float left or right(float:right; ) with CSS it wont work. Where as if I place it absolutely somewhere it will work. Problem is to get it exaclty where I want i need to float it. I have tried placing it inside a relatively placed div absolutely but it still wont let me select. I have also tried styling both classes contactlistdiv and contactlistone but it doesnt make a difference. Any help appreciated. Thanks. First of all, WOW does this look like a site that can make it happen for me.. websitemakingwise. Im new and boy, loving the info so far.. ok, my problem: So Im cleaning up this code, yes.. again. And I wanted to make this automated php thing that sends emails straight to my inbox. Without having to use the client installed. Only problem is that the submit button isnt doing anything. Could someone have a look whats wrong? Filename: ContactForm.html HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>Mailformulier updates - As it is in heaven again</title> <style type="text/css"> <!-- body { background-image: url(afbeeldingen/ups_and_simulation.jpg); } .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 17px; color: #000000; } .style2 {font-family: Verdana, Arial, Helvetica, sans-serif} .style4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; } .style6 {font-size: 14px} .style8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #000000; } a:link {color: #000000;} a:visited{color:#009;} a:hover {color: #000000;} .style10 {color: #FFFFFF} .style14 {font-family:"Bookman Old Style"; font-size: 14px; color: #000000; } #txt{ position:relative; text-align:center; left:100px; top:55px; width:420px; height:40px; z-index:2; font-stretch:wider; } div.row { clear: both; padding-top: 5px; } div.row span.label { float: left; width: 100px; text-align: right; } div.row span.formw { float: right; width: 235px; text-align: left; } div.spacer { clear: both; } --> </style></head> <body> <table width="600" height="400" border="1" align="center" bgcolor="#FFFFFF"> <div id="txt"> <p class="style1">Ja, ik heb interesse. Graag ontvang ik verdere informatie over de toekomstige activiteiten.</p> </div> <tr> <td width="44" height="150"> </td> <td width="814" height="100"> <br /> <br /> <br /> <br /> <div style= "width: 360px; background-color: #ccc; border: 1px dotted #333; padding: 5px; margin: 0px auto;"> <span class="style4"> <form> <div class="row"> <form action="FormToEmail.php" method="post" name="ContactForm"> <span class="label">Naam:</span> <span class="formw"><input type="text" name="Naamgegevens" title="Hier uw volledige naam" size="25" /></span> </div> <div class="row"> <span class="label">Adres:</span><span class="formw"> <input type="text" name="Naamgegevens" title="" size="25" /></span> </div> <div class="row"> <span class="label">Postcode:</span><span class="formw"> <input type="text" name="Postcode" title="" size="25" /></span> </div> <div class="row"> <span class="label">Woonplaats:</span><span class="formw"> <input type="text" name="Woonplaats" title="" size="25" /></span> </div> <div class="row"> <span class="label">Telefoon:</span><span class="formw"> <input type="text" name="Vaste telefoon" title="Uw vaste telefoon-nummer" size="25" /></span> </div> <div class="row"> <span class="label">Mobiel:</span><span class="formw"> <input type="text" name="Mobiel" title="" size="25" /></span> </div> <div class="row"> <span class="label">E-Mail:</span><span class="formw"> <input type="text" name="E-Mail" title="Het E-mail adres" size="25" /></span> </div> <p align="center"> <span class="style14"> <br /> <br /> <br /> ruimte voor opmerkingen/suggesties/reacties</span> <br /> <textarea name="opmerkingen" cols="40" rows="6"></textarea> </p> <div class="spacer"> </div> </form> <div align="center"> <input type="submit" value="Versturen"><br> </div> <br> </div> <div align="center"><span class="style10">-----</span> <a href ="basis.html"><img src = "afbeeldingen/TERUG.png" width="95" height="60" style="border-style: none"/></a></span></div></td> <td width="44"> </td> </tr> <tr> <td height="100" colspan="3"><div align="center"> </div></td> </tr> </table> </body> </html> Thanks for reading till this point! Hop you didnt mind the Dutch lol. FILENAME: FormToEmail.php PHP Code: <?php $my_email = "rsizania@gmail.com"; /* Enter the continue link to offer the user after the form is sent. If you do not change this, your visitor will be given a continue link to your homepage. If you do change it, remove the "/" symbol below and replace with the name of the page to link to, eg: "mypage.htm" or "http://www.elsewhere.com/page.htm" */ $continue = "www.google.com"; /* Step 3: Save this file (FormToEmail.php) and upload it together with your webpage containing the form to your webspace. IMPORTANT - The file name is case sensitive! You must save it exactly as it is named above! Do not put this script in your cgi-bin directory (folder) it may not work from there. THAT'S IT, FINISHED! You do not need to make any changes below this line. */ $errors = array(); // Remove $_COOKIE elements from $_REQUEST. if(count($_COOKIE)){foreach(array_keys($_COOKIE) as $value){unset($_REQUEST[$value]);}} // Check all fields for an email header. function recursive_array_check_header($element_value) { global $set; if(!is_array($element_value)){if(preg_match("/(%0A|%0D|\n+|\r+)(content-type:|to:|cc:|bcc:)/i",$element_value)){$set = 1;}} else { foreach($element_value as $value){if($set){break;} recursive_array_check_header($value);} } } recursive_array_check_header($_REQUEST); if($set){$errors[] = "You cannot send an email header";} unset($set); // Validate email field. if(isset($_REQUEST['email']) && !empty($_REQUEST['email'])) { if(preg_match("/(%0A|%0D|\n+|\r+|:)/i",$_REQUEST['email'])){$errors[] = "Email address may not contain a new line or a colon";} $_REQUEST['email'] = trim($_REQUEST['email']); if(substr_count($_REQUEST['email'],"@") != 1 || stristr($_REQUEST['email']," ")){$errors[] = "Email address is invalid";}else{$exploded_email = explode("@",$_REQUEST['email']);if(empty($exploded_email[0]) || strlen($exploded_email[0]) > 64 || empty($exploded_email[1])){$errors[] = "Email address is invalid";}else{if(substr_count($exploded_email[1],".") == 0){$errors[] = "Email address is invalid";}else{$exploded_domain = explode(".",$exploded_email[1]);if(in_array("",$exploded_domain)){$errors[] = "Email address is invalid";}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match('/^[a-z0-9-]+$/i',$value)){$errors[] = "Email address is invalid"; break;}}}}}} } // Check referrer is from same site. if(!(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){$errors[] = "You must enable referrer logging to use the form";} // Check for a blank form. function recursive_array_check_blank($element_value) { global $set; if(!is_array($element_value)){if(!empty($element_value)){$set = 1;}} else { foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);} } } recursive_array_check_blank($_REQUEST); if(!$set){$errors[] = "You cannot send a blank form";} unset($set); // Display any errors and exit if errors exist. if(count($errors)){foreach($errors as $value){print "$value<br>";} exit;} if(!defined("PHP_EOL")){define("PHP_EOL", strtoupper(substr(PHP_OS,0,3) == "WIN") ? "\r\n" : "\n");} // Build message. function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");} $message = build_message($_REQUEST); $message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL.""; $message = stripslashes($message); $subject = "FormToEmail Comments"; $headers = "From: " . $_REQUEST['email']; mail($my_email,$subject,$message,$headers); ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Dreamweaver Tutorial - Contact Form</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#ffffff" text="#000000"> <div> <center> <b>Thank you <?php print stripslashes($_REQUEST['name']); ?></b> <br>Your message has been sent <p><a href="<?php print $continue; ?>">Click here to continue</a></p> <p><b>Dreamweaver Spot</b> by <a href="http://dreamweaverspot.com">dreamweaverspot.com</a></p> </center> </div> </body> </html> Ok thanks!! So.. whats wrong? Im a total noob.. and it isnt even that I started from scratch.. some of it was already there. Appreciate your advice Hi all, I have a simple newsletter form, so just the email field and a submit, what I would like to do is to send this data to a larger subscriber form, so one that has name, email (with the data previously entered already added), list to subscribe to etc. Can this be done? Thanks Hi Ive done this before but cant remember now. I need to pass a search query but also include another variable in the url but cant remember how to include the extra variable. So the action is SearchResults.php The query is Query And I need to include &siteID=0 So the full url would be SearchResults.php&Query=foobar&siteID=0 My form is like so <form method="get" action="SearchResults.php"> <fieldset> <input type="text" id="seach-text" name="Query" value="" /> <input type="submit" id="search-submit" value="Search" /> </fieldset> </form> To recap how do I include &siteID=0 Thanks! how i do. I have created a form and I want that every time you click the button vote on the text join a number more <form name="Vote"> <input type="text" value="" name="sky"> <input type="hidden" value="1" name="blue"> <input type="button" value="Vote" onClick="document.Vote.sky.value =(document.Vote.blue.value)"> </form> Thanks How increase the value? Hey i'm wrting a simple iphone app (http://geo877.wsnw.net it will kinda run on Firefox and safari. NOT IE) I have a page where the user inputs some data using a form. I was trying to write a script to do the whole flick through page thing (where a users just drags the screen to change page). Anyway, the point is when i put the form into a div tag with the properties of position:relative; you can't click on any of the dropdown boxes or text input, i've read other people have had this problem but it was a pay for answer forum...The same problem happens when i put it in a table edit: It also causes the div or table to be above everything Thanks! <style> .dragme{position:relative;} </style> <div class="dragme"> <table id='mpc' style='display:none;' ><tr><td> <form action="index.php" onsubmit="return validate_form(this);" method="post"> <table> <tr> <td>Amount</td> <td><input type="text" name="amo" size="9" ; /></td> </tr> <tr> <td>Unit</td> <td><select name="unit"> <option value="Oz">Oz</option> <option value="Gram(s)">Grams</option> </select></td> </tr> <tr> <td>Metal</td> <td><select name="metal"> <option value="goldS">Gold Spot Price</option> <option value="silverS">Silver Spot Price</option> <option value="platS">Platinum Spot Price</option> <option value="fineGold">Fine Gold Price</option> </select></td> </tr> </table><p> <center><input type="submit" value="Calculate"/></center> </form> </div> I've set my form up like this: <form action="http://www.***.co.uk/shop/index.php?route=product/search" method="get"> <input type="text" name="filter_name" /> </form> but when I search the path returns index.php?filter_name=*** instead of index.php?route=product/search&filter_name=** any ideas? Thanks Why is this not working? (when i search hiscores it works, but not Google) Quote: <html> <head> <title></title> <script type="text/javascript"> function action( inStr ){ var a = "http://hiscore.runescape.com/hiscorepersonal.ws?user1="; var b = "http://www.google.com/search?q="; var c = document.sform; if( inStr == "h" ){ c.action = a; }else if( inStr == "g" ){ c.action = b; }else{ alert("I don't know where you want to go!!!"); } c.submit(); return true; } </script> </head> <body> <form method="get" action="#" target="_blank" name="sform"> <input name="user1" size="12" maxlength="12" value="" style="font-size: 10px;" type="text"> </form> <br> <input type="button" name="btnH" value="Hiscores" style="font-size: 10px;" onclick="action('h');"> <input type="button" name="btnG" value="Google" style="font-size:10px" onclick="action('g');"> </body> </html> Hi...I'm a novice and trying to develop my website...having a challenge. Here's the issue, and hope that someone more advanced in this might have an idea for me: I've got an affiliate program, and want to give my affiliates some html code to add to their current website that will allow their customers to put their name and email into it which will opt them in to a newsletter that I've got. When they hit "submit" I not only want it to submit their info to my database (which I'm using through 1shoppingcart.com) I want it to open a webpage with the affiliate link to the sales page that I've got. Currently I've got the HTML for them to just sign up for a newsletter, but don't know how to adapt it to open a new window for the affiliates link at the same time. If you've got ANY ideas or want more info on what I'm working with, either post it, or you can contact me offline at jasonsimpson cox net or im me on aim at siweb63 or yahoo at givemeyourhome Thanks a ton!! Jason I'm making a form that contains three places for the user to enter text. The first two are for taking only one line of text, but the third is a bigger input for taking in multiple paragraphs of text. The trouble is, I can't get this third one to wrap the text! Is there a way to turn word wrapping on for an input bar? Or should I be using a different form element? Hi: I would like the freedom to position <input> elements of a form to specific places on my page. What is the proper way to do that please ?? Thanks, -Mel Smith Hello, Does anyone know how to create an input form that saves text to a text file? i.e. a text box with a submit button. Thanks. How do I prefill an input field in a form? I don't mean "value=hello" I mean have a light gray text inside that says "enter your first name" and then when the user starts typing that text disappears. I thought there was an html tag that did this (or a form tag like type=""). I hope it doesn't require CSS... thanks! I installed the simple points system to my phpbb3 forum Im trying too add to that mod and put a box in the viewtopic page so i can edit members points easily. I tried getting the code from the acp and putting that in the viewtopic file but no luck. The box comes up but when i type a amount and click submit it just seems to refresh the page and doesnt change the points amount. Heres a code i made up from the ACP: HTML Code: <form id="user_profile" method="post" action="{U_ACTION}"> <input id="points" type="text" name="points" value="{POINTS}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" /></form> Heres the mod link: http://www.phpbb.com/community/viewt...?f=70&t=543803 I hope you can understand and help . I just want a amount box and submit button below the avatar in the viewtopic file so when i type a amount in the box and click submit the amount of points will change. I have tried the mod creator and the phpbb community for help but ive got nothing that helps. Thanks in advanced. Hi Guys I have a text input field in a form that has data in it from a previous entries. Is there something i can do that ensures the field is empty when the form is pulled up? Thanks everyone This is probably the simplest thing in the world but I can't figure out what to do to make it happen... I need to have an "enter zip code" box with submit button, that opens a link in a new window...where the zip code entered is passed into the link... So, I enter my zip code: 28052 and get this link in a new window when pressing submit: thesiteaddresshere.com/ login/ minisearchpost.cfm? something=1&zipcode=28052 &signup=ouraffiliatecode Thanks in advance for any and all help! David T. Code: <form action="submitreg.php" method="post"> Desired Username: <input type="text"><br> Desired Password: <input type="text"> </form> This is just an ordinary unmodified form I have created. The problem is that the form positioning outputs like this: How do I make this look normal and aligned? Thank you |