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
Ranu Jain SFDCRanu Jain SFDC 

VF page is hanged on Enter event

Hi All,

I struck while working on JS on VF page and need urgetn solution.

my first screed contanins a list with select box. When i press enter on this screen, its next button(command cutton) should work.
On press enter/ clicking the next button, complete form is rerendered.

but when controll goes to second page, the complete screen hanged. 
My first screen and 2nd screen is on the same VF page. only different section is rendered on first and second screen.
Second screen contains text field, text box, and command button.

I have written below code for handling enter 

<script type="text/javascript">
    function replaceEnter(){

        var e = window.event;
          if (e.keyCode == 13){
              var btnId='';
              if('{!strStep}' == '1'){
                  btnId ='ProdSelectionPage_Fav:mainform:pbmain:pageblckBtnSec:cmdNext';
              }
              else{
                  btnId='ProdSelectionPage_Fav:mainform:pbmain:pageblckBtnSec:cmdNextBtn';
              }
              var getButton= document.getElementById(btnId);
              if(getButton!=null)
              {
                  getButton.click();
              }
              
          }
    }

</script>
</from>


 
Shashikant SharmaShashikant Sharma
First use 

try {
Java script code here
}
catch(e) {
alert(e);
}

and see if there is a JS Error or not. Share your results.