javascript - Using enter to select item twitter bootstrap typeahead on firefox -
i having problem firefox submitting form when press come in select item typeahead. chrome , net explorer work expected press come in 1 time select item typeahead press come in 1 time again submit. have been able disable pressing come in submitting completely
function stopenter(e) { if (e.keycode == 13) { e.stoppropagation(); e.preventdefault(); } i prefer firefox working other browsers. here test code.
<html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"> <title></title> <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" /> <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/jquery.js"></script> <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-typeahead.js"></script> <script type="text/javascript"> $(document).ready(function () { var abc = ['asd', 'bvc', 'cxz', 'dsa', 'ewq', 'fgh', 'gfd', 'hrf', 'iuuy', 'aqq', 'bvb', 'ccc']; $('#typer').typeahead({ source: abc }).focus(); }); </script> </head> <body> <form id="form2" runat="server" > <asp:panel defaultbutton="button1" runat="server"> <div> <asp:textbox data-provide="typeahead" id="typer" autocomplete="off" runat="server" /> <asp:button text="submit" id="button1" runat="server" onclick="button1_click" /> </div> </asp:panel> </form> </body> </html> code behind
protected void button1_click(object sender, eventargs e) { response.write(typer.text); } it looks when remove panel can function desired on real page have code on master page in modal , when press come in submit button on original page on.
javascript asp.net firefox twitter-bootstrap typeahead
No comments:
Post a Comment