function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ChermaduraiChermadurai 

problem while pressing enter key

Hi..

 

When i press enter key in text box, it does not performing its operation and doing the command button action..how can i solve this...

ChermaduraiChermadurai

Sureka,

 

<apex:inputText  id="pageno"   tabindex="1" size="1" onkeypress="return noenter(event);" value="{!setCon.pageNumber}" ></apex:inputText>

 

<apex:commandButton id="cmdnxt"  action="{!step2}" value="Next"  />

 

When i give input in input text field and hit enter its doing cmd button action.. i want to stop this and need to perform wat the work assigned for text box..

DaveHDaveH

I would not reccomend using the onkeypress event because it is not fired for most control keys and it varies with each browser. Use the onkeydown or onkeyup events.