Tag: Success lock hold control Enter to resolve bar source code input
"Problem" Sometimes we want to add our own carriage return event to the form form of bootstrap, but I press enter always inexplicably refresh my page.
This is the form and address bar length:
Type 2, enter, the page is refreshed, the address bar becomes like this:
"Cause" in bootstrap, you use an input box that will bind your carriage return event (I'm not sure where the source code is.) );
More than one input entry box, this condition does not occur.
"Workaround 1" Add a hidden form:
<formclass="Navbar-form Navbar-left"role="Search"> <divclass="Form-group"> <input type="text"Placeholder="Please enter ID"Id="Searchvalue" class="Form-control"/> </div> <input type="text"Value="resolving conflicts between Bootstrap and Ajax asynchronous submission forms"Hidden/> <button type="Button" class="btn Btn-default"onclick="Gotosearch ()"> Search </button> <button type="Button"onclick="gotocreate ()" class="btn btn-success"> Create </button> </form>
Workaround 1-Add a hidden form
Solution 2 Change the form to a Div
See Original: Http://www.cnblogs.com/blog-cq/p/5812644.html
<Divclass= "Navbar-form navbar-left"role= "Search"> <Divclass= "Form-group"> <inputtype= "text"placeholder= "Please enter ID"ID= "Searchvalue"class= "Form-control"/> </Div> <Buttontype= "button"class= "Btn Btn-default"onclick= "Gotosearch ()">Search</Button> <Buttontype= "button"onclick= "gotocreate ()"class= "Btn btn-success">Create</Button> </Div>
Workaround 2-Change form to Div
"The new question."
Bootstrap, where is the source of the binding event? I haven't found it yet.
Fix the problem: Bootstrap form form and carriage return conflict