Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"> </script> <script type="text/javascript"> $j = jQuery.noConflict(); $j(document).ready(function(){ $j(".inputSearchText").keypress(function(event){ if(event.keyCode == 13){ $j( ".searchByMe" ).click(); return false; } }); }); </script> <apex:inputText value="{!searchText}" style="width: 300px;" id="inputSearchText" styleclass="inputSearchText"></apex:inputText> <apex:commandbutton value="Search" id="search1ID" styleclass="searchByMe" action="{!doSearch}" rerender="specialPanel"></apex:commandbutton>
http://www.sundoginteractive.com/sunblog/posts/clicking-a-specific-button-when-enter-is-pressed-salesforce
Example 1:- Example 2:-
<apex:inputText (your args) onkeydown="if(event.keyCode==13){this.blur();actionFunction();}" />
<apex:actionFunction name='actionFunction' action='{!doSearch}' />
http://developer.force.com/cookbook/recipe/submit-a-form-with-the-enter-key
Please let us know if this will help you.
Thanks
Amit Chaudhary
All Answers
http://www.sundoginteractive.com/sunblog/posts/clicking-a-specific-button-when-enter-is-pressed-salesforce
Example 1:- Example 2:-
<apex:inputText (your args) onkeydown="if(event.keyCode==13){this.blur();actionFunction();}" />
<apex:actionFunction name='actionFunction' action='{!doSearch}' />
http://developer.force.com/cookbook/recipe/submit-a-form-with-the-enter-key
Please let us know if this will help you.
Thanks
Amit Chaudhary
I think this should help. Let me try out and keep you posted.
Thanks and Regards
Priya
I used the second approach and it worked fine for me.
Thanks and Regards
Priya