Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Having Issue with form

How can i submit form using Enter key

I am able to submit form using button click

Here is my code :

<form role="form" method="post" class="form-horizontal" id="leave_days">
 <div class="form-group">
 <label class="col-sm-2 control-label">Category Name</label>
 <div class="col-sm-9">
 <input type="text" name="txt_catname" id="txt_catename" class="form-control" placeholder="Enter Category Name" />
 </div> 
 </div> 
 <div class="col-sm-9">
 <button type="button" data-style="expand-right" id="btn_reg" class="btn btn-info ladda-button">
 </div>
</form>

Answer*

Draft saved
Draft discarded
Cancel
2
  • 1
    why he needs javascript ? Commented Sep 18, 2015 at 7:37
  • @NullPoiиteя, so even we have type="button" if we put some value in the text box and hit enter key so form won't get submitted. Commented Sep 18, 2015 at 7:40

lang-html

AltStyle によって変換されたページ (->オリジナル) /