0

Both forms don't have submit button. Form A has two textboxes, Form B has only one. My question is : "Why doesn't Form A submit when hitting enter while Form B does?". I don't want to submit the form actually.

Form A

<button type="button" id="login-btn">LOG IN</button>
<button type="button" id="logout-btn">LOG OUT</button>

<div id="div_login_dialog" style="display: none;">
    <form id="form_login_dialog">
        <table>
            <tr>
                <td>
                    <p><label>How many Picklists?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="login-picklist">
                </td>
            </tr>
            <tr>
                <td>
                    <p><label>How many Items?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="login-item">
                </td>
            </tr>
        </table>
    </form>
</div>

Form B

<div id="div_logout_dialog" style="display: none;">
    <form id="form_logout_dialog">
        <table>
            <tr>
                <td>
                    <p><label>How many items didn't picked?</label></p>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="text" id="logout-item">
                </td>
            </tr>
        </table>
    </form>
</div>

Jquery

$("#login-btn").click(function() {
        $("#div_login_dialog").dialog("open");
    });
    $("#logout-btn").click(function() {
        $("#div_logout_dialog").dialog("open");
    });
Paran0a
  • 3,359
  • 3
  • 23
  • 48
Benj
  • 9
  • 3
  • @blgt it says *" I hear of this issue is with IE specifically and not with FireFox or others. **Although it does seem to affect them as well**"*, comments to other [answers](http://stackoverflow.com/a/1370314/2333214) confirms the behaviors exists in other browsers too, and the linked answer actually points to [HTML 2.0 spec](http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2)... which should explain this behavior and clear OP's doubt.. – T J Dec 16 '15 at 13:45
  • I'll admit, I stopped reading the second answer after the live.com link. May be a good idea to flag the question I linked as a duplicate of that as well (since it has the same spec link) – blgt Dec 16 '15 at 13:53
  • having no submit buttons may couse some problems in a form, especially when you want to submit it via JS later on. Also your are using 2 click handler on the same element - you might want to use a namespace. Just sidenotes. – ggzone Dec 17 '15 at 11:55

0 Answers0