HTML - Forms, Click On Link To Submit Not Button
I have a form and instead of clicking on a "Submit Button". I would like to have a text link that can be clicked to submit the action. Any ideas.
Similar TutorialsI am trying to submit a forum through javascript, but the catch is I want to change the name of the button being sent through the form. Here is what I have here is the javascript function. Code: function form_submit(option) { if (option == 1) { alert("Option1") document.submit_form.DE_WEB_COMMAND.value = "Login"; document.submit_form.submit(); } else if ( option == 2 ) { alert("Option2"); document.submit_form["DE_WEB_COMMAND"].value="Activate"; document.submit_form.submit(); } } Code: <form action="/EN/cgi-bin/cgi_chip" method="post" name="submit_form" target="_blank" /> <input type="hidden" name="DE_LS_ATTM_USER_NM" value="" /> <input type="hidden" name="DE_LS_ATTM_USER_PSSW" value="" /> <input type="hidden" name="DE_WEB_PAGE_ID" value="login" /> <input type="hidden" name="DE_USER_VALUE" value="389740" /> <input type="text" id="username" name="DE_LS_IP_ATTM_USER_NM" tabindex="1" maxlength="20" value="" /> <input type="password" id="password" name="DE_LS_IP_ATTM_USER_PSSW" tabindex="2" maxlength="20" value="" /> <input type="submit" class="button" accesskey="l" tabindex="3" name="DE_WEB_COMMAND" value="Sign In" onclick="form_submit(1)" /> <input type="reset" accesskey="r" class="button" tabindex="4" name="Reset" value="Reset" /> <input name="DE_WEB_COMMAND" accesskey="E" type="button" class="button" value="New User? Enrol Now" onclick="form_submit(2)" /> </form> I have stripped out the formatting of the form. Anybody see why it doesn't work? here's is my code <?php if(isset($_POST['submit'])) { $name = $_FILES['fileToUpload']['name']; $tmp_file = $_FILES['fileToUpload']['tmp_name']; $error = $_FILES['fileToUpload']['error']; $size = $_FILES['fileToUpload']['size']; $type = $_FILES["fileToUpload"]["type"]; echo "<table border=\"1\">"; echo "<tr><td>Client Filename: </td> <td>" .$name. "</td></tr>"; echo "<tr><td>File Type: </td> <td>" . $type. "</td></tr>"; echo "<tr><td>File Size: </td> <td>" . ($size/1024). " Kb</td></tr>"; echo "<tr><td>Name of Temporary File: </td> <td>" .$tmp_file. "</td></tr>"; echo "</table>"; $targetPath = '/srv/fff/htddd/uptime/down/'; $targetFile = str_replace('//','/',$targetPath) . $name; move_uploaded_file($tmp_file,$targetFile); echo "Image uploaded successfully to server :"; echo "</br>"; echo $name; echo "<html>"; echo "<head></head>"; echo "<body>"; echo " <form method=\"post\" action=\"http://testrun.libst.siu.edu/drupal/tagdublincore\"> "; echo "<input name=filename value=$name >"; echo "<input type=submit value=\"next\"></form >"; echo "</body>"; echo "</html>"; } ?> <html> <head> </head> <body> <h2>Upload Image</h2> <form enctype="multipart/form-data" method="post" action="http://testrun.libst.siu.edu/drupal/sep1"> <input type="file" name="fileToUpload" /> </br> // I WANT TO HIDE THIS SUBMIT BUTTON AFTER CLICKING <input type="submit" name="submit" value="Upload File" /> </form> </body> </html> I'm having a really weird problem with a standard submit button I'm trying to create. When I preview the site (GoLive CS3) the button doesn't always 'click' or 'depress' down. I can't figure out what is causing this. Anyone here ever seen this happen? Hi guys, I have a drop down box via the <select> tag and then a submit button next to it. I want it so that if the drop-down shows "page 1" or something and then you hit "submit" it links to page 1. Same for "page 2" etc.. Is this possible, and how can I do it please! Thank you for any replies posted! Hi anyone who could help ! In the following code by clicking on the right bottom corner of the image, a link to the destination site occurs. <img src="images/4ticket.jpg" border="0" usemap="#Map" width="203" height="90"> <map name="Map"> <area href="www.destination/play.php" shape="rect" coords="72, 56, 185, 77"> </map Now I would like to replace the link with a form submit button, as I need the value of the submit button (Play FREE!) to be posted to the destination site. Thanks for any help or hint hi guys! great day. i'm having problems getting the code for the submit button linked to my checkboxes. our professor wanted that every option or choice that we check on the check box, by clicking the submit button, the pop window should display "you have chosen (your choice/s that you have checked)" this is the code that my professor gave us. (just copy paste the code and open it) <!Doctype html public *-'W3C// DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content ="text/html; charset = ISO-8859" http-equiv="content-type"> <meta keywords = "begin javascript"> <script type="text/javascript"> function outputVariableValues() { var yourName= document.myform.name.value; window.alert ("Hello: "+ yourName); window.alert ("Your Comment: "+ document.myform.comments.value); window.alert ("Thanks for rating us: " + document.myform.rating.value); } </script> <script type="text/javascript"> document.write("www.Ricmer.Mylene"); window.alert ("Welcome to heaven on earth") </script> <title>Web Form01</title> </head> <body> <center><h1>Nikki Nikko Webpage</h1></center> <form name="myform" method="" action=""> <p><label>Name:<input type ="text" value = "jasmine" name="name" size="25"></label> <p><label>Comments:<br><textarea name = "comments" rows = "4" cols ="36">Enter your comments here. </textarea></label></p> <p><label>Rate our Website</label> <select name = "rating"> <option selected ="selected">Amazing</option> <option>10</option> <option>9</option> <option>8</option> <option>7</option> <option>6</option> <option>5</option> <option>4</option>\ <option>3</option> <option>2</option> <option>1</option> <option>Awful</option> <input type = "button" name="submit" Value="Submit" onclick="outputVariableValues()"> <input type ="reset" value ="Reset" name="Reset"> </form> </body> </html> we're going to pass this activity tonight at 9pm. it's 4:12pm now..-_- this is our first time in html coding so i'm very sorry guys..and thanks in advance! Using below script after clicking the button it will reload the page and starting the application I want people go to anchor link location after clicking the submit button, for example go to the bottom of the page because the program is in the bottom of the page how to do that guys please help Code: echo '<form action="" id="frm_chat" method="post"><fieldset id="fieldset_chat"><legend>Chat</legend><div>'; echo $err_msg; echo "<label>Nick: </label>".$txt_nick->getHtml()."<br />"; echo "<label>Server: </label>".$ddl_server->getHtml()." or ".$txt_server->getHtml()."<br />"; echo "<label>Channel: </label>".$ddl_channel->getHtml()." or ".$txt_channel->getHtml()."<br />"; echo ' <input type="submit" class="btn" name="btn_chat" value="Chat Now"/></div></fieldset></form>'; I am creating a website that has a search button with an image. I would like to know if there is some simple code that I can include that would display the same basic image with a different color when the user mouses over the button. Here is the code: <FORM name="searchform" onSubmit="return validateSearch();" METHOD="POST" ACTION="search_results_lt.asp"> <INPUT TYPE="text" NAME="Search" VALUE="" SIZE="20" > <INPUT TYPE=IMAGE SRC="images/search_button.gif" Name="SearchButton" Value="Submit"> </FORM> **** Thanks for your help, Robin How do I make a script so the submit forms that were submitted go to my email? If you need my whole html/php script to edit it, ill give you. I do not even know where to start for editing. Please tell me where I put my email to make it submit. If its a javascript please help me out. I'm new to this forum and html as well... Might sound like as silly question... I'm an Android application developer. Recently i developed an app to track down the location of the cell phone using inbuilt GPS Receiver. Now, the user gets the coordinates and needs to enter it into a web site text input to get the exact location of his cell phone. I just want two input type="text" field and one input type="Button". inside input types, user needs to fill in Latitude and Longitude value and on clicking the button, a new windows should pop up with a google maps url like the following : - http://maps.google.com/maps?q=28.422523,77.102102 where 28.422523 and 77.102102 are two text field contents passed from input type="text". Thats it. I tried but on submission of the button, the url becomes http://maps.google.com/maps?q=28.422523&r=77.102102 which doesn't work since google maps cant resolute the url. I cudn't remove "&" and "=" sign and replace it with a ",". Help would be greatly appreciated. Thanks... I've got a quick question. I've got a page with about 6-8 forms on it. Several of the forms are nearly identical, as they accept an ID number, or a selection made from a pop-up option list. What I want to do is collapse the identical forms into a single data entry area and then have several different submit buttons which have different values, then use the value of the submit button to determine what action to perform for the form. My question is... is this a proper use of the type=submit input element, or am I better off keeping the forms separate. All the forms call the same PHP script (itself) to perform the action. I'll be trying it out, but I don't want to waste time redesigning the page if what I'm trying to do will not work. Thanks. ok so i have a java script that directs someone to a site based upon which radiobutton they choose after the cllick submit and then i have BLue mail form which sends me the form data when they click submit the problem is how do i get both of these things to happen? i created this code to try and figure out how to do it <head> <script language="JavaScript"><!-- function go(what) { for (var i=0; i<3; i++) { if (what.sameName[i].checked == true) location.href = what.sameName[i].value; } } //--></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form> <form action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="post"> <br><input type="radio" name="sameName" value="http://www.google.com"> Google <br><input type="radio" name="sameName" value="http://www.yahoo.com"> Yahoo <p> Name: <input name="first_name" type="text" style="width: 199px;"><br /> <input type="hidden" name="sendtoemail" value="Myemail-address"> <input type="button" onClick="go(this.form)" value="Continue"> </form> </body> </html> I am a HTML noob so i kinda need a step by step or code answer.. Hello, I am trying to create a form so that member can submit a file to our Yahoo! Group. However, I cannot get it to work. Perhaps that this is not even possible? I have an html file that can click on and after they have filled out the form, they would click "submit" and it would post that file into out Yahoo! Group file section. If this isn't possible, is there a way to have it bring up a page with all the information on it after they submitted it so they can just copy and paste? Thanks, DarkEdward hey all, Thanks for looking at my issue, what i am trying to do is as follows! On my page http://cre8tivepixels.com/Quote%20form.html I have a quote form up the top, that works fine, i then added a section where models could send me three photos, when you click on these tabs it loads the photo up, but all i get is an email with the photo names but NO photos? What do i have to put in my script to make it so i recieve there jpegs, and not just the name of the file? Can this even be achieved? Basically i want the photos that a model submits to be delivered in my email address the same as my Quote Form above? Hope that makes sence? Cheers Dan Hello Friends, Plz let me know how to hide content before clicking on Submit Button, the message should be displayed in a new pop up window only if we click on Submit button. Plz let me know hot to write the code for this.... Ok, I'm wanting to add a text box to my site and when you click a button it'll open the letters in the text box as a url for my site For example, in the text box I have hello when I click the button it'll open up http://htmlforums.com/hello.htm I also need to know how to add .htm to after the string in the text box when you click the button. I also want this to open in the same window. Any help please? Thanks. My page contains several iframes and each contains a form. In IE (but not in FF), when I submit a form, the action page is shown in a new window. How can I make it so the action page is instead loaded inside the iframe? Hi... I got a question tht puzzeled me whole day and i dont know how to solve,Can you please help me? My main page is at /usr/local/share/HT/html/server/index.html. Now that inside my main page i want to do a link by a button click to the another page, say page 8. page 8 is at /data/website. But whenever i tyr to click on tht button, it says "PAge not found" Followimng is my coding <br><input type="submit" value=" Viewing " onClick="location.href='/data/websites/page8.html'"; onMouseOver="info('Viewing'); return true" onMouseOut="info(' '); return true" ></br> Can anyone guides me step-bystep, please :-) I need to make a button whose value is "times clicked: 0" and the number increments every time the button is clicked so after one time it should say times clicked: 1 I Don't know how to do this though, is a javascript function the best way? Hi guys I trying to create a html page with php that links to an SQL DB,I currently have 2 separate forms that submit information to the DB when I click the button relating to that form.I am trying to create it so that I have one submit button and when I click that it will enter the information from both forms into that DB. Here is my code (HTML Page) Code: <html> <head> <title>update database</title> </head> <body> <form method="post" action="update.php"> title:<br/> <input type="text" name="solution" size="70"/></br> <input type="submit" value="Insert saved solution here"/> </form> <form method="post" action="update.php"> title:<br/> <input type="text" name="problem" size="70"/></br> <input type="submit" value="State the type of problem occurred"/> </form> </body> </html> (Seperate PHP Page) Code: <?php $solution = $_POST['solution']; mysql_connect ("localhost", "root","password") or die (mysql_error()); mysql_select_db ("heskdb"); $query="insert into hesk_std_replies (solution) values ('$solution')"; mysql_query($query) or die ('error updating database'); echo"database updated with:".$solution; $problem = $_POST['problem']; mysql_connect ("localhost", "root","password") or die (mysql_error()); mysql_select_db ("heskdb"); $query="insert into hesk_std_replies (problem) values ('$problem')"; mysql_query($query) or die ('error updating database'); echo"database updated with:".$problem; ?> Any help would be much appreciated Thanks |