Sample Code:
<apex:page>
<script type='text/javascript'>
function noenter(ev) {
if (window.event && window.event.keyCode == 13 || ev.which == 13) {
callAcctRet();
return false;
} else {
return true;
}
}
</script>
<apex:form>
<apex:actionFunction action="{!retToAcct}" name="callAcctRet"/>
<apex:inputText value="{!firstName}" onkeypress="return noenter(event);"/>
<apex:form>
</apex:page>
Cheers!!!
<apex:page>
<script type='text/javascript'>
function noenter(ev) {
if (window.event && window.event.keyCode == 13 || ev.which == 13) {
callAcctRet();
return false;
} else {
return true;
}
}
</script>
<apex:form>
<apex:actionFunction action="{!retToAcct}" name="callAcctRet"/>
<apex:inputText value="{!firstName}" onkeypress="return noenter(event);"/>
<apex:form>
</apex:page>
Cheers!!!
How to do same functionality in lightning experience. because this window function not working in lightning.
ReplyDeleteThanks in Advance
Check this - http://www.infallibletechie.com/2018/09/how-to-call-javascript-method-on-enter.html
Delete