Firefox 4 submit button problem - html

In Firefox 4 when I press submit button nothing happens. The code of button is:
<input class="button" type="SUBMIT" value="Login" form="dataForm" name="event_Login">
On Firefox 3.6 the button is working OK. Some solution?

It appears the problem is with form="dataForm". When I remove that attribute, the button works fine again in FF4. The value of the form attribute should be the id of a form to submit, otherwise the button will do nothing (at least in FF4). For instance, this button will work:
<form id="dataForm">
<input ... form="dataForm" />
</form>

Not sure if it's your problem, but I had a similar one - solution was putting "SUBMIT" in lowercase.

Related

Browser Inconsistencies: Working around FORM submission differences

https://jsfiddle.net/516amfmL/2/ -- click into the form input, press ENTER
<form onsubmit="return false;">
<button style="display: none !important;" onclick="alert('!! Should NOT see this !!');">Hidden Button</button>
Click in input, press ENTER: <input type="text" />
<p>
<button onclick="alert('this is okay');">Visible button</button>
</p>
</form>
When running the above JS Fiddle, Chrome & Firefox work the same, MS Edge & Safari do things differently. I listed this as a bug in Chrome, and was quickly told that they were following the HTML standard which states:
4.10.22.2 Implicit submission -- A form element's default button is the first submit button in tree order whose form owner is that form element.
No one thought to make it clear in the standard if it should ignore hidden elements.
Anyways, that's not my question. My question is what's the best way to work around this issue?
A hidden button on a form is still active and has always been this way, but it's natural to think it would or should be automatically disregarded.
One possible fix to your problem is to change the first button to an <input type="button"/>
<input type="button" style="display: none !important;" value="Hidden Button" onclick="alert('!! Should NOT see this !!');"/>
This works on Chrome and Edge.
Here's your fiddle updated.

Odd browser compatibility issue with IE/Firefox

I have a login script based on PHP and Javascript. I couldn't figure out for the longest time why it would work in chrome and safari but not in firefox or internet explorer. I finally figured out the issue is with the html, instead of having the regular submit button I have an image for submit. and simply changing type="image" to type="submit" resolves the issue. Does anyone know why this is and if there's a compatible way to write the following
This works:
<input name="doLogin" type="submit" style="margin-left:90px;" id="doLogin3" value="Login">
This does not:
<input name="doLogin" type="image" src="login-btn.png" style="margin-left:90px;" id="doLogin3" value="Login">
if you are not going to be using js to submit your form, then the input type for your submit button should be submit. but if you really must have an image in place of your button, just position the image with css by setting it as the background of your button. no need to change input type to image. hope that helps.

Chrome doesn't disable submit button with span

If I have a submit button with a span inside it, it looks like Chrome still allows the span to be clicked when the button is set to disabled.
<form method="post" action="/changestatus" id="yw0">
<input type="hidden" name="id" value="5">
<input type="hidden" name="status" value="enabled">
<button type="submit" disabled="disabled">
<span>Submit</span>
</button>
</form>
The preceding code works as expected in Firefox, but not in Chrome.
Any ideas on fixing this (without JS if possible).
Thanks!
For submitting the form it does not submit in either browser (as it should).
If, though, with allows the span to be clicked you mean javascript firing the click event when clicking on it, then indeed there is a difference on how they handle this case.. (you will have to handle it through javascript)
If you don't want the form to submit you can add this code to your form element.
<form onSubmit="return false;">
I know its a JavaScript fix, but it is one.

Why doesn't enter work when submitting a form in IE6?

(I just finished developing my new site and I am testing if it works in all browsers. I need everything to be perfect.)
I have a form:
<form action="example.php" method="post">
<input type="text" name="example">
<input type="submit" name="button" value="Submit">
</form>
Everything in this form works fine in Chrome, Opera and FF, But in IE6 it doesn't.
When I press enter, it doesn't do anything. The form doesn't get submitted.
So I have to go over to the submit button with my mouse and click it if I want to submit.
Is there any way to fix it?
Check for Javascript that might be preventing you from achieving the expected behavior.
And please, consider dropping support for IE 6. IT IS ALREADY 10 YEARS OLD!!!!!!

google chrome submits form even if there is no SUBMIT button

This bug/feature cropped up in one of my pages when viewed in google chrome so i wrote a test page which looks like this
<body>
<form action="loginhandler.php">
<input type="text" id="name">
<input type="text" id="lastname">
<input type="button" value="Login">
</form>
</body>
Here you can see, the input type is NOT of type submit. So if you press ENTER KEY on IE,Firefox,Opera, nothing happens and that is the expected behavior.
But if you press enter on chrome, it SUBMITS regardless of whether the input type is submit or not.
My question , is this a default feature/bug of chrome or am i doing something wrong here. ?
To cite section 4.10.21.2 of the HTML5 specification:
"If the form has no submit button,
then the implicit submission mechanism
must just submit the form element from
the form element itself."the form element itself."
Therefore I believe Chrome's behaviour to be correct, although I think other browsers do this as well. You can catch/block/process form submission by listening to the "submit" (e.g. to block it) event.BlockquoteBlockquotethe form element itself."
Not even Chrome, most of browsers submit once you press enter (even there is not submit button) when cursor in input.
I have the opposite problem. I use custom js-element for my form and when i use style='dispay:none;' for the submit button, chrome does not submit form on enter, although, firefox does :(