Problem Passing Variable to Submit Form in Firefox
- by George
In the following example, I have a link that sends a variable to a function which checks if the variable is true and, if so, submits a form on the page. This has been tested and works in IE, Safari, and Chrome, but not Firefox. Trying to figure out what's wrong in Firefox.
The function which checks 'action' and then submits form 'login' :
function submit(action) {
if (action == "submit") {
document.login.submit();
}
}
Link to pass action variable and submit form:
<a href="javascript:submit('submit');">SEND FORM</a>
When I remove the check and just have the following, it works fine in Firefox:
function submit() {
document.login.submit();
}
<a href="javascript:submit();">SEND FORM</a>