Sign in or 

|
ehsan.odyssey |
Missing inputText value after onClick event
Nov 2 2009, 7:58 AM EST
I wanna fire a click event on a button when the onKeyPress on an inputText triggered.(Im using IE)javascript function : function enterKeyPressed(tablename,commandname){ var str="form1:"+tablename+":"+commandname; if(window.event.keyCode==13) { submitForm('form1',1,{source:str}); return false; } } problem : Sometimes after typing into input text and pressing enter key ,the page refreshes and value of input text disappears and the event doesn't fire properly. Also, I tried this code: function enterKeyPressed(tablename,commandname){ if(window.event.keyCode==13) { var cmnd = document.getElementById("form1:"+tablename+":"+commandname); cmnd.click(); return false; } } Could anyone tell me why the value disappears? Do you find this valuable? |