HTML - Connecting A Form To A Button
I want to make a form that when you type in it it doesnt show what you are typing, i want it to show "Albert please answer the following question" and then you type a semi colon it goes into another box (irrelevant) but when you type a ? in the second box the actual phrase that you typed in the first box (the one that was hidden by my phrase) to come up under the whole thing, and then when you hit the "new question" button it should reset itself. i figured that the way you could do this is by connecting the first box with the answer box but i cant figure out how to make this happen iwhtout using php.
Similar TutorialsHi all, I am trying to make my menu for my future web site. I am new to CSS + PHP, so please forgive my ignorance. My html file contains this: Quote: <!doctype html> <html> <head> <meta charset="UTF-8"> <title>Meditation</title> </head> <body> <?php include("header.php");?> </body> </html> It is saved as meditation.html My PHP file contains this: Quote: <div> <ul> <li><a href="home.html">Home Page</a></li> <li><a href="gallery.html">Gallery Page</a></li> <li><a href="about.html">About Page</a></li> <li><a href="contact.html">Contact Page</a></li> </ul> </div> It is saved as header.php My CSS file contains this: Quote: [...] /*<--Begin Header--> /* #header{ position:relative; height:60px; background-color:#2946F3; width:100%; display:block; overflow:auto; } /*<--End Header-->/* [...] The site I will be making is educationbeyondtheclassroom.com After I upload these and go to educationbeyondtheclassroom.com/meditation.html I receive a blank page. When I view source, the html is their from the meditation page, but the PHP + CSS that I am trying to connect don't appear to be in right. Any help would be most appreciated! Thank you, Ryan Hello, I would like to move my button or <FORM> to different position than at the default location. How can I do that? Hi guys, I'm currently making a simple website for a coffee website and am currently working on the order page, which is a form and uses javascript. After trying to make the 'help' button open a new page, pretty much everything stuffed up and i'm in need of urgent help. Any help would be greatly appreciated. Here is the 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>Order Coffee</title> <script language="JavaScript" type="text/javascript" src="../javascript/order.js"> </script> <link rel="Stylesheet" href="../CSS/coffee.css" type="text/css" /> </head> <body> <!-- The whole page is a form --> <form name="payment" action="" onClick="return goTohelp();" onSubmit="return validateOrder();"> <h1> Elmilio's Cafe </h1> <br /> At Elmilio's Cafe we like to ensure that our deliveries are fast and on time <br /> <b> Please fill in all the boxes to complete your order </b> <table border= "0" cellspacing= "5"> <tr align="left"> <td> First Name: </td> <td><input name="firstName" type="text" value="" /></td> <td> Surname: </td> <td><input name="surname" type="text" value="" /></td> </tr> <tr> <td> Address: </td> <td><input name="address" type="text" value="" /></td> </tr> <tr> <td> Suburb: </td> <td><input name="suburb" type="text" value="" /></td> <td> State: </td> <td> <select name="state"> <option value="0">South Australia</option> <option value="1">Victoria</option> <option value="2">New South Wales</option> <option value="3">Queensland</option> <option value="4">Northern Territory</option> <option value="5">Western Australia</option> <option value="6">Tasmania</option> </select> </td> <td> Postcode: </td> <td><input name="postcode" type="text" value="" /></td> </tr> <tr> <td> Email: </td> <td><input name="email" type="text" value="" /></td> <td> Contact Number: </td> <td><input name="contactNumber" type="text" value="" /></td> </tr> </table> <hr /> Enter your coffee order: <br /> <textarea name="comments" cols="40" rows="5"> Enter your coffee order here... </textarea><br /> <hr /> Please enter method of payment <p> <input name="r" type="radio" value="creditcard" onclick="creditcard()"/> Credit Card <input name="r" type="radio" value="paypal" onclick="paypal()"/> Paypal <input name="r" type="radio" value="onlinebanking" onclick="onlinebanking()"/> Online Banking <div id="creditcard"> <hr /> <img src="../images/creditcard.jpg" alt="Credit card options"/> <table border= "0"> <tr align="left"> <th>Type of Credit Card</th> <th>Name on the Card</th> <th>Card Number</th> <th>Expiry Date</th> </tr> <tr> <td><select name=""> <option value="0">Visa</option> <option value="1">Mastercard</option> <option value="2">American Express</option> </select></td> <td><input name="nameonCard" type="text" value="" /></td> <td><input name="cardNumber" type="text" value="" /></td> <td><select name=""> <option value="0">01</option> <option value="1">02</option> <option value="2">03</option> <option value="3">04</option> <option value="4">05</option> <option value="5">06</option> <option value="6">07</option> <option value="7">08</option> <option value="8">09</option> <option value="9">10</option> <option value="10">11</option> <option value="11">12</option> </select> / <td> <select name=""> <option value="0">2010</option> <option value="1">2011</option> <option value="2">2012</option> <option value="3">2013</option> </select> </td></tr> </table> </p> Place your order <input type="submit" value="Submit" /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" onClick="goTohelp()"/> </div> <div id="paypal"> <hr /> <a href="https://www.paypal.com"/> <img src="../images/Paynow.jpg" alt="Pay now" border="0"/> </a href> </p> <br /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" /> </div> <div id="onlinebanking"> <hr /> <b> Account Name: </b> Elmilio's Cafe <br> <b> Bank: </b> Westpac Bank <br> <b> BRB: </b> 28 5265 <br> <b> Account No.: </b> 8276 1736 <br> Please give us the reference number, given <br> Place your order <br> <input type="submit" value="Submit" /> <input type="submit" value="Clear Form" /> <input type="submit" value="Help" /> </div> <div id = "bottom_links2"> <hr /> <a href="contact.html"> Contact Us </a>| <a href="privacy.html"> Privacy </a>| <a href="copyright.html"> Copyright </a> <br /> <a href="mailto:williamdickeson@yahoo.com.au?subject=Coffee Query"> Contact the Web Administrator </a> </div> </div> </form> </body> </html> Here is the javascript: PHP Code: //This will display the Credit Card div when the Credit Card radio button is selected function creditcard(){ document.getElementById("creditcard").style.display = "block"; document.getElementById("paypal").style.display = "none"; document.getElementById("onlinebanking").style.display = "none"; } //This will display the Paypal div when the Paypal radio button is selected function paypal(){ document.getElementById("paypal").style.display = "block"; document.getElementById("creditcard").style.display = "none"; document.getElementById("onlinebanking").style.display = "none"; } //This will display the Online Banking div when the Online Banking radio button is selected function onlinebanking(){ document.getElementById("onlinebanking").style.display = "block"; document.getElementById("creditcard").style.display = "none"; document.getElementById("paypal").style.display = "none"; } //Check if email is entered correctly function validateOrder() { var email= new String(document.payment.email.value); if (email == "" || email.indexOf("@") == -1) { alert ("Your email address is not valid"); } //Check if first name is entered var firstName= new String(document.payment.firstName.value); if (firstName == "") { alert ("You have not entered your first name"); } //Check if surname is entered var surname= new String(document.payment.surname.value); if (surname == "") { alert ("You have not entered your surname"); } //Check if address is entered var address= new String(document.payment.address.value); if (address == "") { alert ("You have not entered your address"); } //Check if suburb is entered var suburb= new String(document.payment.suburb.value); if (suburb == "") { alert ("You have not entered your suburb"); } //Check if postcode is entered var postcode= new String(document.payment.postcode.value); if (postcode.length != "4") { alert ("Your postcode must have four digits"); } //Check if contactNumber is entered var contactNumber= new String(document.payment.contactNumber.value); if (contactNumber == "") { alert ("You have not entered your contact number"); } //Check if nameonCard is entered var nameonCard= new String(document.payment.nameonCard.value); if (nameonCard == "") { alert ("You have not entered your name on your credit card"); } //Check if cardNumber is entered var cardNumber= new String(document.payment.cardNumber.value); if (cardNumber == "") { alert ("You have not entered your card number"); } function goTohelp() { var window.location = "http://javascript.internet.com/new"; } } } i have a form that returns the user upon a number of errors (of course) - i'm able to retain the text input data (value="<?php echo $_POST['em_name'] ?>") upon return, but i don't know how to retain the radio button or checkbox data so that they don't have to recheck it if necessary. it's in html/php... can someone help? much appreciated... GN Ok. This is my coding for my form button. The opacity changes, when hovered over, in my editor and in IE - but it doesnt work in Netscape - any suggestions or ideas???? <input type="image" src="buttons.jpg" onmouseover="this.style.Opacity=1.0[1];this.filters.alpha.opacity=100" onmouseout="this.style.Opacity=0.7[1];this.filters.alpha.opacity=70" style="filter:alpha(opacity=70);opacity:0.7.[1]" size="25" value="Find password" /> I think the title says it all. I want to submit the information from a form to 2 different pages: one page is an external page (so it starts with action=http://www.otherserver.com/somescript.php), and the other is internal (so it starts with action=myscript.php). And all that is done with a click of a button, so don't tell me to use 2 buttons The reason why I want to do this, because I want to put the information in my database as well. Is there a way to get around this? Or maybe another technique to get the same purpose? Hello, I have done a search form in HTML (with something in Javascript), and a reset button that works perfectly. The search results are published on the same page of search form, but once its searched the reset button no longer works. So, once the form is submited, reset button stops working ... someone knows how can I fix it? Thank you very much and best regards to all! Hi everyone, Is it possible to have a form without a submit button. I know you can use links etc to submit a form but can you just have nothing, so the user just hits the enter key and the form submits ? cheers I'm trying to create a HTML website and I want to make it so it will call a web service (.asmx) that is located on a remote server (so the HTML page is hosted on a different server as the web service). The web service currently has one webmethod (HellowWorld) and all it does is receive a string then returns another string. I was wondering if anyone have a tutorial or sample code that I can follow to do this? I'm not having much luck looking it up (might not be using the right key words). Hi all..I'm actually working on an html website..I need help in connecting my database (Access) to my webpage..can any one help me for the codes imtek <html> <form> <p><input type="text" name="T1" size="20" /></p> <p><input type="submit" value="B1" name="B1" /></p> <p><input type="submit" value="B2" name="B2" /></p> </form> </html> Say I have the above form in a web page. When the page loads, the browser will highlight the first submit button b1, such that if the user hits enter, the form is submitted with that button. I'd like the default button to be B2, which is displayed second on the form. I'd greatly appreciate any advice on how to accomplish this. Thanks, jsfgguy In my HTML page, I have two forms. Form 1: Radio Button A, Radio Button B, Radio Button C Form 2: Radio Button D, Radio Button E, Radio Button F. Form 2 Radio Button are disabled. If I click on A, D will be the only button enabled, if I click on B, E will be the only button enabled, if I click on C, F will be the only button enabled. However, when I click on one of the Radio Buttons of Form 1, if I am using the Internet Explorer (version 6), the radio buttons in Form 2 are still disabled. It is not until I click on somewhere else that the proper button will be enabled. So, if I click on A, nothing will be enabled. After I click somewhere else, only after that D is enabled. Worse, if I click B, nothing happens and when I click C next, E will be the one enabled (but when I click on somewhere else, F will be enabled). This only happens in Internet Explorer. It works fine with Mozilla Firefox. I'd like to know if there's a solution to this if I am using the Internet Explorer. Here's a sample of my code: <form name="form1"> <input id="ButtonA" type="radio" name="radiobutton" value="valueA" onChange="document.form2.d.disabled=false;document.form2.e.disabled=true;document.form2.f.disabled=t rue;"> <input id="ButtonB" type="radio" name="radiobutton" value="valueB" onChange="document.form2.d.disabled=true;document.form2.e.disabled=false;document.form2.f.disabled=t rue;"> <input id="ButtonC" type="radio" name="radiobutton" value="valueC" onChange="document.form2.d.disabled=true;document.form2.e.disabled=true;document.form2.f.disabled=fa lse;"> </form> <form name="form2"> <input id="ButtonD" id="d" type="radio" name="radiobutton" value="valueD" disabled=true> <input id="ButtonE" id="e" type="radio" name="radiobutton" value="valueE" disabled=true> <input id="ButtonF" id="f" type="radio" name="radiobutton" value="valueF" disabled=true> </form> Please kindly help. Thank you. Best regards, ChrisX Hi guys, I have made a website, and it has a text box that I want people to type their email address in, and I have a regular link next to it that says "submit" (not a button or anything). Basically I want the email address that they have entered to be emailed to me when they click the submit link. My hosting is currently just free-hosting at awardspace - is this possible to do there? If not - generally how can I make it work? Thank you for any replies posted :-) I have a form with radio buttons. I want it so that only one is selectable at a time and if radiobutton 1 is selected then whenever another radiobutton is selected radiobutton 1 will be deselected. Here is the code: HTML Code: <html> <head> <title> </title> <script src="script.js"> </script> </head> <body> <form> <input type="radio" id="hbEgg" value="hb"> <label for="hb"> Hard Boiled Egg </label> <br /> <input type="radio" id="mbEgg"> <label for="mb"> Medium Boiled Egg </label> <br /> <input type="radio" id="fbEgg" value="fb"> <label for="fb"> Full Boiled Egg </label> <br /> <input type="radio" id="ebEgg"> <label for="eb"> Extra Boiled Egg </label> <br /> </form> </body> </html> Thanks in advance. Ok, so I hope there is a simple answer to this. I just haven't been able to figure it out. I have a basic form that has a dropdown menu. I am using an image as the submit button. The problem I am having is that the image does not align vertically properly next to the dropdown menu. Below is what my form looks like in the browser. Any ideas how to get this aligned correctly? Thanks for all help! Hello All! I am a newbie to HTML and am having the most troubling time getting my submit button on my form to redirect to another webpage. I have been reading (searching) through previous posts on this issue but none solved my problem. I am really hoping someone can offer some help so let me explain my issue exacly. I have a simple form on my "Contact Us" page with a few fields and a [Submit]button. After the form is filled out and the [Submit] button is pressed, I would like it to re-direct to a "Thank-You" page I created. Below is my code: <form action="gdform.asp" method="post" name="contact_us" id="contact_us" target="cont"> <input name="submit" type="image" value="submit" src="images/Submit.gif"> If I take target="cont" out, it redirects to the home page. I have been trying to figure this out for so long now and searching online with no luck. Any help with this would be GREATLY appreciated!!!! Thanks! I have created a button which is linked to some JavaScript to dim the screen when it is pressed. using CSS I have changed the image of the button using a graphic. The graphic is a .PNG as it uses transparency but when set the image as the button it has lost all transparency is there anyway to enable the transparency of the .PNG this is the code I am using to do it. Code: <input type="button" onClick="d()" class="button"> Hi, I am struggling to find a solution to my problem, believe me i have searched google with every different combination of words to find the answer to this question but i cant find one. Basically have i done this: <form action="page.cgi" method="GET"> <input type="image" src="play.gif" name="cmd" value="START" > </form> Ok, the button with the image displays, BUT! Instead of passing the value START to "cmd" within "page.cgi" it passes the x and y coordinates of the image where i have clicked. Now this works perfectly like this: <form action="page.cgi" method="GET"> <input type="submit" name="cmd" value="START" > </form> So my question is, how do use a submit button with an image, without getting the coordinates returned. Any help would be GREAT. Hi, I got a HTML form whose submit button doesnt seem to be working, Any help would be appriciated. The link to the form is http://new.johnnyshotel.com/contact.html . I tried the same form in a different plain html file and it seems to work but when I insert it back into this webpage template the submit button doesnt seem to work. Thanks in advance. |