Location: Oracle Discussion Forums FAQ

Discussion: Missing inputText value after onClick eventReported This is a featured thread

Showing 1 post

ehsan.odyssey
Missing inputText value after onClick event
Nov 2 2009, 7:58 AM EST | Post edited: 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?    
Keyword tags: community faq forums

Sign in to be the first to reply.

Related Content

  (what's this?Related ContentThanks to keyword tags, links to related pages and threads are added to the bottom of your pages. Up to 15 links are shown, determined by matching tags and by how recently the content was updated; keeping the most current at the top. Share your feedback on Wetpaint Central.)