HTML - Send Form Inputs To A Second Site?
Ok, so I need something so that others can kinda half-email me (you'll get it later):
Code: <form><input type="text" /></form> <form><input type="text" /></form> <img src="submit.jpg" /> So, the idea is that they write their email in the top one, and a short message in the bottom one. This is perfectly fine as it is. I don't want big text-boxes and stuff like that instead, so don't change this part. The submit.jpg is a picture that sais submit (duh..), and I'd like for this button to take this information posted into these forms and post it on another page. In other words, this can be compared to an e-mail webmaster kinda thing, and then I could go to this secret second page, and read it like this: person1@something.com There's a bug in your site. person2@something.com Cool site dude. person3@something.com Wow.. Get it? The layout of site 2 isn't important, as only I will be reading it. Also, the button would have to hide the URL it is posting to, so that others can't just read at the bottom that it will be sent to mysite.com/thispage.html. Can someone please, please, PLEASE try to help me with this??? Similar TutorialsI'm pretty new to HTML coding, and I think I'm close to getting this correct. I want to forward username and passwords typed into this site (near the bottom): http://www.mscd.edu/~career/ to automatically log people in to this site: https://www.myinterfase.com/metrostatecollege/student/ Code: <h2 align="center">Metro State Joblink Student Login</h2> <form method="post" action="https://www.myinterfase.com/metrostatecollege/student/" target="_blank"> <input type="hidden" name="offsite" id="offsite" value="1" /> <div id="container"> <div id="main" style="width:500px"> <div class="panelRow"> <span class="panelLabel">Username:</span> <span class="panelForw"><input type="text" id="username" name="username" /></span> </div> <div class="panelRow"> <span class="panelLabel">Password:</span> <span class="panelForw"><input type="password" id="pwd" name="pwd" /></span> </div> <div style="padding-left:115px;"><input type="Submit" id="submit" value="Login" /> </div> <div style="padding-left:115px;padding-top:8px;font-size: 10pt; font-family: verdana, arial, helvetica, sans-serif;"> <a href="https://www.myinterfase.com/metrostatecollege/studentregistration.aspx" target="_blank">Register Here!</a></div> <div style="padding-left:115px;padding-top:8px;font-size: 10pt; font-family: verdana, arial, helvetica, sans-serif;"><a href="https://www.myinterfase.com/metrostatecollege/passwordreset.aspx?ac=274" target="_blank">Forgot Password?</a> </div> </div> </div> </form> Hi, I've encountered this problem, and been struggling for few hours. Thing is, I have a form with enctype="multipart/form-data" and 2 inputs with type "file" in it with names RequestForm[doc1] and RequestForm[doc2]. When I submit the form, only the first one of the fields is sent into $_POST. If i comment out the 1st field, then only the second is sent. This thing is just killing me! Could someone help? What might be wrong? And yes, I do need 2 inputs, not 1 multifile input. My site is being developed in html. I want to give an option of sending email. Is this possible in html to send an email if yes means can anyone send me the code I got this form in simple html HTML Code: <form name="input" action="display.html" method="get"> Username: <input type="text" name="user" /> <input type="submit" value="Submit" /> </form> When the user clicks the submit button the user should be directed to display.html and should display the name he entered on the form previously. I want the coding in either javascripts or html. y javascript or html ? I want to upload form to a site, so that users can download the form and then fill that form and view what they entered.. To fill the form when running in local machine, you cannot have php scripts, Not all will hav ephp installed in their Pc's.That's y i want in javascript or html... I want to know whats the script to be in display.html page to view the name entered by the user on the form page.......... 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 I'm trying to set up a website for my Mom, and I'm not very familiar with this stuff. I created the form below, but when I try it I get 3 or 4 pop ups about security and then it still doesn't send the data, and when I had my friend try it said she couldn't because the had no profile. Quote: <FORM METHOD="POST" ACTION="mailto:sharyl@sharylsphotojournal.com"> Name: <BR> <INPUT TYPE="text" NAME="name" SIZE="35"><BR> Email(If you want a response):<BR> <INPUT TYPE="text" NAME="email" SIZE="35"><BR> Message:<BR> <TEXTAREA NAME="message" ROWS=7 COLS=35> </TEXTAREA><BR> <INPUT TYPE="submit" VALUE="Send"> <INPUT TYPE="reset"> Can anyone help me know what I did wrong? Hi, I'm working on a contact form and its almost finished. There are 2 main offices the form can go to. for example UK office and France office. I want to add 2 check boxes or radio boxes so that the person filling out the form can choose which office they want the form to go to. Is this possible and if so anyone got exampel code i can use to add to my form and mail.php script? how to send e-mail from a form?... hi everyone this is my first post here and hope i will get solution of my problem i have designed an form and want when user click on submit button i can recieve that data into my email. here is the code <FORM METHOD="POST" ACTION="mailto:mandeep@vbams.com" ENCTYPE="text/plain"> <INPUT TYPE="text" NAME="username"> : name <BR> <INPUT TYPE="text" NAME="email"> : email <BR> comments <BR> <TEXTAREA NAME="COMMENTS" ROWS="10" WRAP="hard"> </TEXTAREA> <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE="http://www.vbams.com/index.html"> <BR> <INPUT TYPE="submit" VALUE="Send"> <INPUT TYPE="reset" VALUE="Clear"> </FORM> this is not working can any one help me how to modify this code so it work properly Thanks Mandeep I know how to create a form to send an email, but I'm wondering if it's possible to have a form send either an event notification or outlook calendar event that would set up an outlook event reminder once accepted by the recipient. Does anybody know if that's at all possible with HTML or Javascript? Thanks. Hi there, i would really appreciate if someone could help me. i have first tried a few things from searching around on google. but i either dont understand or its just not working!... first of all ill say im a beginner in html. but i created a survey/quiz page.. just a simple thing to see if i could. Using radio boxes etc.... I have a submit button at the bottom, but i want to know how to direct it to my email address? so that i receive the responses and can send the reply? i tried a form method to mailto my email but it doesnt work. so i think i may be on the wrong path.. all that happens is the page reloads. anyways could someone help. my page is being being hosted by free server, will this make a difference? thanks for your time. Hello guys, Can anyone help me with a simple form. I need a form like this: A box where the user can enter his email adress. Under it a button: Send this to my email The function will be that a certain text is sent to his email adress. The text is one I choose before. Thanks guys! Hello, I am trying to to write HTML code that will let people fill out a form, but I need it sent to an email address (tcutler@lighthouseandmeyu.org) This is what I have: HTML Code: Please Provide Your Input!: <form action="tcutler@lighthouseandmeyu.org" METHOD=POST> <P><TEXTAREA ROWS=10 COLS=50 NAME=Comments></TEXTAREA></P> <P><INPUT TYPE=SUBMIT VALUE=Send></P> </FORM> Hello, I have a code ( see below) with a while loop that gives me a table that shows on the right side after every entry a link 'EDIT' that sends the variabe id to the script 'editjoke.php'. while ($joke = mysql_fetch_array($jokes)) { $id = $joke['id']; $joketext = htmlspecialchars($joke['joketext']); echo "<td>$joketext</td>\n"; echo "<td ><a href='editjoke.php?id=$id'>Edit</a></ td>\n"; echo "</tr>\n"; Now I created a new code with the same idea but it should have on the left side 'radio-buttons' and on the left side only one EDIT-button. Two days ago I thought it works but now it seems so that the variable is not send to editjoke.php. Here is the code: <form action="editjoke.php" method="post"> ... ... while ($num = mysql_fetch_array($number)) { //echo "<tr valign='top'>\n"; $id = $num['id']; $Auskunft = htmlspecialchars($num['Auskunft']); //echo "<td>$Auskunft</td>\n"; <input type="hidden" name="id" value="<?php echo $id; ?>" /> <input type="submit" value="SUBMIT" /> } </form> How do I have to change the code that the variable 'id' will be send to the script edithjoke.php? I have this code that I am using for a contact form on my website. What do I need to add for it to send the data in the fields to my email address Code: <form name='Contact Time For You' action='sent.htm' method='POST' enctype='multipart/form-data' onsubmit='return verifyMe();'> <table class='table_form_1' id='table_form_1' cellspacing='0' width="271" align="right"> <tr> <td class='ftbl_row_1a' width="241" align="left" > <font face="Arial" size="2"><LABEL for='Full_Name' ACCESSKEY='none' ><b style='color:red'>*</b>Your Name </label></font> <font face="Arial"> <input type='text' name='Full_Name' id='Full_Name' size='34' value=''></font></td> </tr> <tr> <td class='ftbl_row_2a' width="241" align="left" > <p> <font face="Arial" size="2"><LABEL for='Email' ACCESSKEY='E' ><b style='color:red'>*</b><u>E</u>mail Address </label></font> <font face="Arial"> <input type='text' name='Email' id='Email' size='34' value=''></font></td> </tr> <tr> <td class='ftbl_row_1a' width="241" align="left" > <p style="margin-top: 0; margin-bottom: 0"> <font face="Arial" size="2"><LABEL for='Telephone' ACCESSKEY='T' ><b style='color:red'>*</b><u>T</u>elephone </label></font> </p> <p style="margin-top: 0; margin-bottom: 0"><font face="Arial"><input type='text' name='Telephone' id='Telephone' size='15' value=''></font></p> <p style="margin-top: 0; margin-bottom: 0"> </td> </tr> <tr> <td class='ftbl_row_2a' width="241" align="left" > <font face="Arial" size="2"><LABEL for='Enquiry_Text' ACCESSKEY='none' ><b style='color:red'>*</b>Enquiry</label></font><font face="Arial"><textarea name='Enquiry_Text' id='Enquiry_Text' cols='28' rows='6' value=''></textarea></font></td> </tr> <tr> <td class='ftbl_row_1a' width="241" align="left" > <p> <font face="Arial" size="2"><LABEL for='Code' ACCESSKEY='none' ><b style='color:red'>*</b>Offer Code </label></font> <font face="Arial"> <input type='text' name='Code' id='Code' size='34' value=''></font></td> </tr> <tr> <td align='center' width="249"> <p style="margin-top: 1; margin-bottom: 1"> </p> <p style="margin-top: 1; margin-bottom: 1"><font color="#FFFFFF"> <input type='submit' name='submit' value='Send' style="float: right; color: #FFFFFF; font-family: arial; font-weight: bold; background-color: #000080"></font> </td> </tr> </table> </form> Thank you in advance, Dan 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. I am creating web service. But the problem must be somewhere on HTML page. When I submit form, the data send by web service (java program) to the page does not show up. If I do not submit form, then the program works; results appear on the page. The form is submitted invoking pushSubmit() javascript function. This method is invoked from setMessage() javascript function. I submit form cause in this way I discover what value is selected on drop down list. This is done using JSP code. Can I do it somehow else. Next action using retrieved data is to invoke Java class on server side. What might be the problem? This is the code: Code: <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" pageEncoding="UTF-8" %> <%@ page import="mart.ebay.database.ReadsCategoryTable" %> <jsp:useBean id="categoryList" class="mart.ebay.database.ReadsCategoryTable" scope="request" /> <jsp:setProperty name="categoryList" property="*"/> <!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=UTF-8"/> <title>eMart</title> </head> <body class="create"> <!-- shows items from that country by default --> <% // String strSiteId = "EBAY-GB"; // Object categoryList = session.getAttribute("items"); // receives result from servlet // out.println(categoryList + " result ++++++++++++++++++++++++++++"); // strSiteId = (String)session.getAttribute("siteId"); // strSiteId =(strSiteId == null)? "": strSiteId; // out.println(strSiteId+ " strSiteId +++++++++++++++"); %> <% String result= ""; String strSiteId = request.getParameter("siteId"); strSiteId =(strSiteId == null)? "": strSiteId; if(strSiteId.equals("")) { out.println(strSiteId+ " global ID is empty"); result= categoryList.readTable("EBAY-GB"); } else { out.println(strSiteId+ " this is global ID"); result= categoryList.readTable(strSiteId); } %> <div id="container"> <div id="header"> <h1>Header</h1> <!-- end of header--> </div> <div id="mainContent"> <h1>Main content</h1> <!-- onsubmit="run()" --> <form name="form" id="form1" action="index.jsp" method="post" > <table id="input" border="0" cellpadding="0" cellspacing="5"> <tr> <th align="left">Looking for</th> <th align="left">Location</th> <th align="left">Category</th> </tr> <tr> <td align="left"><label><input style="width: 230px" type="text" name="message" id="message" /></label> </td> <td> <select name="siteId" id="siteId" > <option <%=(strSiteId.equals("EBAY-AT"))?"selected":""%> value="EBAY-AT">Austria</option> <option <%=(strSiteId.equals("EBAY-AU"))?"selected":""%> value="EBAY-AU">Australia</option> <option <%=(strSiteId.equals("EBAY-CH"))?"selected":""%> value="EBAY-CH">Switzerland</option> <option <%=(strSiteId.equals("EBAY-DE"))?"selected":""%> value="EBAY-DE" >Germany</option> <option <%=(strSiteId.equals("EBAY-ES"))?"selected":""%> value="EBAY-ES">Spain</option> <option <%=(strSiteId.equals("EBAY-FR"))?"selected":""%> value="EBAY-FR">France</option> <option <%=(strSiteId.equals("EBAY-FRBE"))?"selected":""%> value="EBAY-FRBE">Belgium (French)</option> <option <%=(strSiteId.equals("EBAY-NLBE"))?"selected":""%> value="EBAY-NLBE">Belgium (Dutch)</option> <option <%=(strSiteId.equals("EBAY-FRCA"))?"selected":""%> value="EBAY-FRCA">Canada (French)</option> <option <%=(strSiteId.equals("EBAY-ENCA"))?"selected":""%> value="EBAY-ENCA" onclick="pushSubmit()" >Canada (English)</option> <option <%=(strSiteId.equals("EBAY-GB"))?"selected":""%> value="EBAY-GB" selected="true">United Kingdom</option> <!-- <option value="EBAY-HK">Hong Kong</option> --> <option <%=(strSiteId.equals("EBAY-IE"))?"selected":""%> value="EBAY-IE" onclick="pushSubmit()" >Ireland</option> <option <%=(strSiteId.equals("EBAY-IN"))?"selected":""%> value="EBAY-IN">India</option> <option <%=(strSiteId.equals("EBAY-IT"))?"selected":""%> value="EBAY-IT">Italy</option> <!-- <option value="EBAY-MOTOR">Motors</option> --> <option <%=(strSiteId.equals("EBAY-NL"))?"selected":""%> value="EBAY-NL">Netherlands</option> <option <%=(strSiteId.equals("EBAY-NLBE"))?"selected":""%> value="EBAY-NLBE">Belgium (Dutch)</option> <option <%=(strSiteId.equals("EBAY-PH"))?"selected":""%> value="EBAY-PH">Philippines</option> <option <%=(strSiteId.equals("EBAY-PL"))?"selected":""%> value="EBAY-PL">Poland</option> <option <%=(strSiteId.equals("EBAY-SG"))?"selected":""%> value="EBAY-SG">Singapore</option> <option <%=(strSiteId.equals("EBAY-SE"))?"selected":""%> value="EBAY-SE">Sweden</option> <option <%=(strSiteId.equals("EBAY-MY"))?"selected":""%> value="EBAY-MY">Malaysia</option> <option <%=(strSiteId.equals("EBAY-US"))?"selected":""%> value="EBAY-US">United States</option> </select> </td> <td> <select name="Category" > <option value="100" ><%= result%></option> </select> </td> <td> <label> <input type="button" value="Start" onclick="run()"/></label></td> </tr> </table> </form> </div> <div id="footer"> <p>Footer</p> </div> <!-- the end of container--></div> <script type="text/javascript"> function getXmlHttpRequest() { try { // Firefox, Opera 8.0+, Safari return new XMLHttpRequest(); } catch (e) { // Internet Explorer try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return null; } } } } function setLocation(location) { strSiteId = location; var xmlHttp = getXmlHttpRequest(); xmlHttp.open("GET","app/messages/location/" + location,true); xmlHttp.send(null); } function setCategory(category) { var xmlHttp = getXmlHttpRequest(); xmlHttp.open("GET","app/messages/category/" + category, true); xmlHttp.send(null); } function setMessage(index) { var xmlHttp = getXmlHttpRequest(); //alert(index) xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { // document.write(xmlHttp.responseText.indexOf("<body>")); if(xmlHttp.responseText.indexOf("<body>") != -1) { s = xmlHttp.responseText.substring(xmlHttp.responseText.indexOf("<body>") + 6, xmlHttp.responseText.indexOf("</body>")) document.getElementById("output").innerHTML=s; } else { document.getElementById("output").innerHTML=xmlHttp.responseText; } pushSubmit() // submits form } } xmlHttp.open("GET","app/messages/" + index,true); xmlHttp.send(null); } function run(){ setCategory(document.form1.Category.value) setLocation(document.form1.siteId.value) setMessage(document.form1.message.value) alert(document.form1.Category.value+" "+document.form1.siteId.value+ " "+document.form1.message.value) } function pushSubmit() { document.getElementById('form1').submit(); } </script> <% // sessionObj = null; //arlItems = null; //session.removeAttribute("items"); //session.removeAttribute("siteId"); %> <h3>result</h3> <div id="output" style="border: 1px solid black; color: black; height: 18em; width: 100%"></div> </body> </html> Hey guys I have made search form on my site but how do i get it to search my site when the user clicks search. Tried to find a tutorial on this but no luck. HTML Code: <form action="?" method="post" name="searchfield" id="searchfield"> <p>Search the Web: <input name="search" type="text" class="search" size="15" /> <input name="submit" type="submit" class="submit" value="Search" /> </p> </form> I know I have to create a script which I wold like to do in php but what do I add to the script Hi guys, Quite new to web design and having trouble getting the form on my sites contact page to work, it simply just isn't doing anything! Tried playing around with the code for hours with no luck, the form can be found he http://davidgeaney.co.uk/contact.html Any help at all would be greatly appreciated Thanks Dave |