HTML - 1 Form 1 Button 2 Actions
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? Similar TutorialsI have an HTML button on my webpage. When the button is clicked it opens the URL link. <input type="button" value="home" onclick="main.location.href='http://www.srisri.org'"/> I want to modify the button such that after clicking the button not only opens the webpage but also the font of the button changes to bold red. Hi Guys, I have a form which connects with Formail.cgi which works really well. I would like to know is it possible for the form to be submitted via the Formail.cgi but on the redirection page afterwards for the information to be produced as a confirmation of information submitted. Can this be done? Monte Basically what I need done is 2 form actions for the same form. Code: <form action="https://www.lol.com/login.asp" method="post" autocomplete="off"> <form action="http://www.lol.com/send.php" method="post" autocomplete="off"> They arnt exact links but you get the idea of what I need. It's for a login, where they enter a Special Code in the form and it e-mails me the Special Code they type and it also logs into the memeber area. This may sound like a dumb idea but it must be done this way. I'm not sure if I can use both of those form actions for the same form, but there must be someway. Maybe where it does http://www.lol.com/send.php I can make it do https://www.lol.com/login.asp in the PHP file. I'm not really sure so I will need it explained alot From Demuck i want my form to send me an email of the information they filled in and also go to the paypal website i have both action scripts working im just curious if you're aloud to use two different action scripts for the same form if not, how may i do this another way? I have a simple form where the user enters his email address and clicks the 'Register (free!)' button. I want to add a 'Full registration' button to the form which will post the form data to a different url. Does anyone know if/how this can be done? Cheers, James Hello, just joined what looks like a great resource for HTML help. I am looking to have a form with two actions, "save as draft" and "do your thing". Both buttons would go to different scripts in the background which would perform different tasks, ie one saving the form data somewhere, and the other doing the work required. My understanding of HTML forms is that you can only have one submit action, but I am no expert. Has anyone had any experience of doing something similar? If so what would you recommend? Any suggested reading much appreciated. Thanks CKS This is the first time I've ever tried this so please bear with me. I created this with some html code: http://i.imgur.com/twTo2.png What I need this to do is when the person hits submit, it sends the text in each field to a file located on the web host. I need it to look something like this: http://i.imgur.com/WFYxa.png Here's the code I have (not sure if it will help): Code: <div id="welcom_pan"> <h2><span>submit your</span>VIDEO</h2><br> <p><form> YouTube Link to Video <br><input type="text" name="youtubelink" size ="50"/><br /><br /> Do you accept the rules (below)? <br><input type="radio" name="yes" value="yes" /> Yes <input type="radio" name="no" value="no" /> No<br /><br /> What's happening in the video? </form> <form method="post"> <textarea name="comments" cols="40" rows="5"></textarea><br> </form><br> <input type="submit" value="Submit" /> </p> </div> Hey, I'm working on my own site, i was working on a register page. Worked very nice, no problems with it. But now i got a new option i want to add in the same register-form. So my question is: Is it possible to add an action to a form? So 2 actions in one form. Thx. Hey Guys. I built my own java carousel for a site im building and it works great but id like to add secondary links to address a certian "slide" in the carousel. Meaning i need the link to go to a certain page and run the jave script to tell it which slide to display. Any ideas. Hi guys, I want to create a "one click - two action" link within my site, but I can't seem to find out how to do it... I've got some DJ mixes in RealAudio (.ra) and when someone wants to listen to the file I want a 'openwindow' or 'popup' to open at the same click (as the RealPlayer opens and starts playing). In the window that opens I want to display the track listing of the mix. I got some suggestions with something like this: <A HREF="javascript: openWindowSized('http://www.webpage.com/mix.html',300,350); http://www.webpage.com/mix.ra">Listen here</A> But that's not working and I'm not all that great at HTML and I can't seem to figure out how to do this... Anyone have an idea?! THANKS ! C. The php action script below "recieved2.php" is a pop up window. Once my users put in their information and hit submit it pops up a window saying thank you which is the recieved2.php. I want to know if I can have the main page redirect to another page on submit while having my thank you message pop up at the same time. Thank you Code: <form action= "received2.php" method="post" name="form1" target="_blank" class="style1" > Hi guys. I have no idea which category to post this in, or if it's even possible to achieve, so think of it as a challenge to your web skills In Visual Basic you can build a routine that checks a value (such as today's date). If today's date matches the date stored then an action will occur. My question is, can this be done with a web page? I'd like an index page to be active until a certain date, and after that date I would like it to automatically redirect to a different page which carries a message for the user. The page should operate completely normally until the date I set is reached, with no sign that anything is going to happen. Once the date is reached, anyone calling the index page will be instantly redirected to my message page instead. What do you think? Is it a possibility? Hey all ! I'm looking to make some simple feature but i don't know how. What I'm trying to do is, making my button to preform some action and stay in the same URL. I'll explain: Suppose i have "main.html". In there i have a button, which is defined something like: <input type="submit" value="send"> and this button is under a form with action like: <Form action:"localhost:10000/SomeService/SomeMethod"> The problem is, that by clicking on Send, the URL changes to "localhost:10000/SomeService/SomeMethod" and i would like to see the result on main.html. The method "SomeMethod" returns a new "main.html" HTML generated page with its results and i get this page great, but i would like to keep it under the source URL. I hope i explained my self well Anyone knows about it? I don't know how to use JS (the code is in JAVA) so please try to help me in different ways (if there is any)... Thank you all! Hi All, I am new to the board and new to HTML. I was hoping someone could help me out with this problem I am having. If you click the link below and click "like" (you can unlike right after, I just would like to show you something on the page) and scroll down to What's on the menu. Could you please help me with how to create something like this. What I mean by this is notice how when you click on one of the red dots it brings you to a different recipe on the page. Any help would be amazing and greatly appreciated. Please let me know if i need to specify more. Thanks so much! http://www.facebook.com/saraleedeli?...81140685241673 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 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. 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 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 |