I have two different text boxes (coming from loop). Right now data is submitting with "click" event. But now I want to "Post" data after "enter" button also (for example facebook comments). How can I do this?
Here is my code
foreach ...
{
<!-- First text box -->
<input type="text" placeholder="Post your comment here" id="txt'.$FeedId.'" class="feed_in_input" name="">
<img class="feed_reply_smiley2" data-coin='.$CoinId.' data-max2='.$postID.' data-min2='.$postID.' data-stat='.$PostStatus.' id="button'.$FeedId.'" src="'.base_url().'/assets/social/images/feed_reply_smiley.svg" alt="img">
<!-- Second text box -->
<input type="text" placeholder="Reply to '.$UserName.'" id="txt'.$FeedId.'" class="feed_in_input" name="">
<img class="feed_reply_smiley" id="button'.$FeedId.'" src="'.base_url().'/assets/social/images/feed_reply_smiley.svg" alt="img">
}
Here is my script
$('.feed_reply_smiley2').unbind().click(function(e) {
//our code here
});
$('.feed_reply_smiley').unbind().click(function(e) {
//our code here
});
I just want whenever user press "enter" button to any text box then function should execute same as working on "click" event. How can I do this?