收录日期:2019/02/17 00:00:00 时间:2010-06-16 01:05:36 标签:javascript,html,forms
I have the the following code and want to use a hyper link to submit my form.
<form name="form_signup" id="form_signup" method="post" action="/" enctype="multipart/form-data">
...
<input type="submit" value="Go to Step 2" name="completed" /> or <a onclick="javascript:this.form.submit();">Proceed without uploading</a></span>
</form>
However, my hyperlink submit doesn't work. It just keeps me on the same page.
Question: any idea why my link submit text doesn't work?
The this
in your "javascript:this.form.submit();"
refers to the <a>
tag, which has no form
property, resulting in a JavaScript error.
The smallest required change, but far from the most elegant, would be something like this:
<a href="javascript:document.getElementById('form_signup').submit();">...</a>
JavaScript: Text u201Csubmitu201D link?
Submit Link - No Javascript: Downsides?
jquery submit form from text link
submit php variables with javascript (link?)
Use javascript to alter submit link
Javascript text to link replacing
javascript limit display link from text area
change link text in HTML using JavaScript
JavaScript for loop not changing link text
Javascript Submit
html/javascript automaticly getting link from submit button (maybe automating with python?)
Javascript firefox extension to get the text around the link
How to include javascript generated text into html link?
Page moves on link submit
If i enter a website link in a text box and submit i need to get that specific website detais. Similarly like facebook link module?
Javascript: Check if the user is navigating away with a form submit or a simple link click
JavaScript on Form Submit
JavaScript replace form submit