HTML - Form Not Submitting Due To Action?
ooh, its been a long time since i had to ask a question in here.
i have a form that just wants to redirect to the home page, no matter what the action is. HTML Code: <form id="contactForm" method="post" action="index.phtml?file=contact.phtml" enctype="multipart/form-data"> <input class="input" name="contact_name" type="text" onfocus="if(this.value == 'Name:') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Name:' }" value="<?php echo (!empty($_POST['contact_name']) && $_POST['contact_name']) ? $_POST['contact_name'] : 'Name:'; ?>" /> <input class="input" name="contact_phone" type="text" onfocus="if(this.value == 'Phone:') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'Phone:' }" value="<?php echo (!empty($_POST['contact_phone'])) ? $_POST['contact_phone']: 'Phone:'; ?>" /> <input class="input" name="contact_email" type="text" onfocus="if(this.value == 'E-Mail:') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'E-Mail:' }" value="<?php echo (!empty($_POST['contact_email'])) ? $_POST['contact_email']: 'E-Mail:'; ?>" /> <textarea name="contact_message" cols="1" rows="1" onfocus="if(this.value == 'Message:') { this.value = ''; }" onblur="if(this.value=='') this.value='Message:'" /><?php echo (!empty($_POST['contact_message'])) ? $_POST['contact_message'] : 'Message:'; ?></textarea> <a href="#" class="right link1" onclick="document.getElementById('contactForm').submit()">Send</a> <a href="#" class="right link1" onclick="document.getElementById('contactForm').reset()">Clear</a> <input name="ContactSubmit" type="hidden" /> </form> and its not submitting. i think i messed up the link submits, what url shoudl be in there, when i put in index.phtml?file=contact.phtml it stays on the page but doesnt process. also, is the enctype correct for this type of post? also my doc type is xhtml strict, but i am going to have to satisfy a couple errors as far as that is concerned as well, its complaining about Quote: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag when i change the action even to itself which is /contact.phtml it still redirects to the home page. i have to ask it, what obvious fundamental have i forgotton? EDIT, ok it must be in the link submits, when i delete the href tag out of it completely, it seems to be processing. i cant figure out why the # sign was in there, whats supposed to be there for a link submit? i trued a url and that didnt work right Similar TutorialsHi all, I have a query that I hope somebody can help with as my site has been brought to a standstill because of this problem. I have just posted the new version of my site online and I have a folder below the domain root which contains things like database info, form scripts etc. When I process the form I get a 404 error. the action is something like HTML Code: action="../includes/process_form.php" There is no need to any output from these files as they process the information and direct to the relevant files above the domain root using php header scripts. At the beginning of most of my files I have the following PHP Code: <?php $security = 'secure'; require('../includes/default.php'); require('../includes/error_handlers.php'); require('../includes/db.php'); ?> and there is no problem with these whatsoever. I had all of the scripts working fine when I tested them at domainroot.co.uk/take2/public/ domainroot.co.uk/take2/includes/ Does anybody have any ideas why this is happening Any help would be appreciated John Hi, Is there any way to have more than one action script in a form? Thanks in advance! Geetha hi i was wondering if anyone has any idea how i can add more then one form action to the same page? i have 2 in my page but they are conflicting with each other thanks... This is how i have it in my page: Code: <form name="form" method="post" action="login.php"> form action 1 my code here..... </form> <form name="form" method="post" action="index.php"> form action 2 my code here..... </form> I made a HTML Submittion, but everytime a user adds stuff, like their name, etc. it redirects to another page. Is it possible, to let the HTML Submisision, submit the details, without it going to a different page? Hello everybody, If I have a simple form that I need to constantly submit, is their a way where I can add some information to the URL that will automatically click "submit" for me, nothing in the form needs to be filled out. Here is a copy of the form: <form method="post" name="vali"> <input type="submit" name="vote" value="Submit Form"> </form> This is the current format of the URL (PHP) http://abc.com/?action=1234&id=5678 I would greatly appreciate any help. Thanks, DreAdeDLyNcH Okay I've made a Form using html, and I need help on how to Submit it. I used "mailto:" which was a mistake I think... It always opens Microsoft Outlook even when that person doesn't use it, and has to download it. The easiest way for me to get the submissions would be from email, but I need something that will let you pick an email client or something... Just something simple. Any help? I'm having trouble with the submitting of a form. Here's my code: HTML Code: <form method="POST" action="example.php" name="r"> <br><br><table cellpadding="3%" cellspacing="0" width="30%" align="center"> <tr align="center"><td class="tablehead2" colspan="2">SCRIPT CHECK</td></tr> <tr align="center"><td class="mainnowidth2" colspan="2"><img src="captcha.php"></td></tr> <tr align="center"><td class="mainnowidth2">Enter Code:</td><td class="main2"><input type="text" name="code"></td></tr> <tr><td align="center" colspan="2"><input type="submit" class="subin" name="verify" value="Submit!"></td></tr> </table> </form> When i enter something into the text input and press the return key, the page loads but the script runs as if the POST data was never entered, but if i click the submit button or press tab and then return, it works fine. Can anyone suggest what the problem might be, and a possible solution? Thanks in advance for any help. This maybe a dumb question. I form that I use for my mailing list. I am having trouble getting the cursor to display as a text cursor over the input section and a hand cursor over the "sign up" button. Ref: http://bigdogcattle.com Here is the html code: <div class="form_contents"> <label for="email">Join our Mailing List</label> <input type="text" name="email" /> <br/><br/> <input type="submit" value="Sign Up!"/> </div> Any ideas? Thanks, Jamie Hey guys I am making a application form for my website and I have a few questions... After the application is complete and they hit Submit I want a message to come up and say "Thank you for the application" Then it clears all the text boxes etc to default so they know that the application is complete. How do I get that happening? Also I want the application to go to my email however I do not want the application to open a email form, at the moment I have got Code: <form action="MAILTO:contact@xin-gaming.com" method="post" enctype="text/plain"> but that opens up an email form so that they send it as if it was an email which I don't want. I want it to send it to my email but without the applicant knowing that it's going to my email. Sorry for the confusion >< Thank you in advance Hi, Is there any way to have more than one action script in a form? Regards, Geetha Can i assign a URL like index.php?page=result using the get method in a php form. Ex: HTML Code: <form action="?page=results" method="get"> <input type="submit" value="Submit"> </form> So, I have made a form as a pre-LAN-event thing.. The problem is that I have never really used forms before and am not really that familiar with more advanced HTML besides simple layout stuff.. So my question is, how do I take the information from this form: HTML Code: <form name="input" action="Result.asp" method="get"> <font size="2" face="arial">Gender:<select name="gender"> <option value="male">Male</option> <option value="female">Female</option> </select> <br> Age:<select name="age"> <option value="12">0-12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25+</option> </select><br><br /> <b><u>What games do you want to see tournament in?</u></b><br /> <input type="checkbox" name="Game" value="CS16" /> Counter Strike 1.6<br /> <input type="checkbox" name="Game" value="CSS" /> Counter Strike Source<br /> <input type="checkbox" name="Game" value="LoL" /> League of Legends<br /> <input type="checkbox" name="Game" value="LoLD" /> League of Legends Dominion<br /> <input type="checkbox" name="Game" value="TF2" /> Team Fortress 2<br /> <input type="checkbox" name="Game" value="TF2" /> Left 4 Dead 2 Versus<br /> <input type="checkbox" name="Game" value="MC" /> Minecraft PvP<br /> <input type="checkbox" name="Game" value="BC" /> Bloodline Champions<br /> <input type="checkbox" name="Game" value="RoA" /> Rock of Ages<br /> Other: <input type="text" name="otherGame" /> (ex. 1, ex. 2, osv.) </font><br /> <input type="submit" value="Submit" /> </form> and submit it to another page so I can go on there and see how many males, females and people of different ages that have signed up, and what games they wanted. Sorry if it is a noobish question.. Thx in advance. - Ward, out! Hi. I'm trying to clear a contact-form when when the user has pushed the submit button. Anyone know how to do this? The reason I want this is because a new window opens and tells the user that the message has been sent. And when this window is closed the message is still in the form. Hope i make myself clear Parashurama I have been trying to add a text field to a pre-existing form which is submitted to my email. It is an order form and I want to add an area for the user to input their country. It shows up on the webpage but when I get the information the user has submitted in my email the Country data is not coming through. The webpage is http://earfdn.org/form11.htm The problem is towards the bottom under the Ship To: title. Please help! And thank you so much for your time. Hey guys. This is my coding, below, for a form on my site. It's just the default white color (and is too bright for my site's color scheme). Is there any way I can change the color to grey or something else?? THanks in advance!! <form action="http://www.xxx.com/xxx/xxx/xxx.php?group=2" method="post"> <div align="center" style="height:30px;"><font size="1px" color="999999" face="Arial"><b>enter your email address and your info will be emailed to you</b></font></div><div align="center" style="height:30px;"><input name="email" value=" " /></div><div align="center"><input type="image" src="buttons.jpg" size="25" value="Find password" /></div> </form> I''m making a form with three input bars. When the user presses "submit", the contents of the three inputs is put together in a string, which is then sent to a CGI program. Is there any way to add arbitrary text to that string - whether before or after the stuff gathered from the form's inputs - so that my CGI program can know which form called it? ok....i have a htm form that has fields that do a get to a aspx datagrid page. this is done in the action part of the form. i set in the form to target a new winodw but how can i have that new window open with no browser menu? i have googled and found ways to do this in the input onclick but either im setting it wrong or it will not work with the get action Code: <form name="Form1" method="get" action="../lookup/phydatagrid.aspx?tablename=physicians" onsubmit="return validateZIP(this.zipcode.value, this.radius.value, this.name)" target="_blank"> Hi all, I'm looking for ways, how I can avoid multiple form submissions, when a user repeatedly (intentionally or not) refresh the browser (F5 button) after submitting a form? The input in my form is simply an email address. Nothing else. It is used for forgot password function. I have tried unset or set the $_POST['email'] to empty, but it doesn't help. Is there a clever way to do this? It submits in every other browser BUT IE... I just finished this website and it works everywhere except IE... I don't get it!!! I'm using image inputs to submit the form. Is that bad? It obviously sends me to the next page, but why isn't the data going through? the form exists on this webpage http://awesomebattle.com/compare.php it's the frame with the two random characters in it... here is the code. Code: <form method="post" name="vs" id="vs" action="vs.php" > <table width="100%"> <tr> <td align="center" valign="top" width="30%" bgcolor="#ff9900" > <font size="5"><a href="http://www.google.com/search?q=Captain America" alt="Detailed Info" title="Detailed Info" target="_blank">Captain America</a><br><input type="image" id="w" name="w" VALUE="l" border="0" width="300" height="300" src="pic/1278364692captain america.jpg"></font></td> <td valign="top" width="40%" align="center"><img width="150" border="0" src="pic/1277747612fight.png"><br> <input type="image" id="w" name="w" VALUE="d" border="0" src="draw.png" > <br> <input type="image" id="w" name="w" VALUE="" border="0" src="idk.png" > <table width="300" bgcolor="ff9900" ><tr><td colspan="2" align=center ><font size=1>1 vote</font></td></tr></table> </td> <td align="center" valign="top" width="30%" bgcolor="#ff9900" > <font size="5"><a href="http://www.google.com/search?q=Polaris" alt="Detailed Info" title="Detailed Info" target="_blank">Polaris</a>, <a href="http://www.google.com/search?q=Killer Bee" alt="Detailed Info" title="Detailed Info" target="_blank">Killer Bee</a>, <a href="http://www.google.com/search?q=Haku" alt="Detailed Info" title="Detailed Info" target="_blank">Haku</a><br><input type="image" id="w" name="w" VALUE="r" border="0" width="150" height="150" src="pic/1278365600Polaris.jpg"><br><input type="image" id="w" name="w" VALUE="r" border="0" width="150" height="150" src="pic/1277849407killerbee.jpg"><input type="image" id="w" name="w" VALUE="r" border="0" width="150" height="150" src="pic/1278365133haku.jpg"></font></td> </tr> </table> <br> <a href="javascript:toggle_visibility()" ><font style="BACKGROUND-COLOR: #ff9900" size=2 >Leave some commentary for others to see!</font></a> <div id="ads" ></div> <div id="notes" style="display:none;" align=center> <table width="400" bgcolor="#ff9900"><tr><td align=center> Name <input id="name" type="text" name="name" VALUE="" maxlength="30" size=15 alt="Tell us your name" title="Tell us your name" ><br> <font size=2>Commentary</font> <textarea name="comments" cols="40" rows="5"> </textarea><br><font size=1>When you pick a winner the comment will be submitted.</font> </td></tr></table> </div> <input type="hidden" id="compare" name="compare" VALUE="0" /> <input type="hidden" id="rights" name="rights" VALUE="3" /> <input type="hidden" id="lefts" name="lefts" VALUE="1" /> </form> I'm thinking it's a I hate I.E. I really do. So many people use IE so I have to make this work with my site. Is there a connection between a form's "submit button" <input type="submit"> and it's "action/method/enctype" attributes <form action="url" method="post" enctype="text/plain">? Is there a difference between "submitting" a form and "posting" a form or is it all interconnected? Does the form's "action/method/enctype" attributes have to be set to allow the "submit button" to do anything? Do the "action/method/enctype" attributes have to be triggered by a "submit button"? Once I understand how this all works, I want to run some checks on user entries/selections in a form when the user clicks the submit button. These checks will be carried out by a JavaScript function. If there are problems with the user's selections/entries I want to; 1) suspend submission/posting 2) alert the user to the errors they have made via an alert box 3) allow the user to make corrections, then they click submit again 4) test the user's selections/entries again 5) if user's selections/entries are now OK, submit/post the form data or if still not OK go back to step 2 above. Any hints on how to do this? Maybe I should forget the submit button and use a command button? Is there a "submit" method I can place in a JavaScript function? |