Jump to content

Javascript events


napsternapster

Recommended Posts

Hi people,

 

I'm using two events(onblur & onkeypress) in one input text(<input type='text' onblur='selectOption(event)' onkeypress='selectOption(event)' >) and these two events they the same function.

 

function selectOption(text,current,next,previous,contact_type,detailed_type,e)

{

current = document.getElementById(current);

next  = document.getElementById(next);

previous_id = document.getElementById(previous);

 

if(e.type == 'blur' )

  {

  ShowNext(text,current,next,previous,contact_type,detailed_type);

  }

  else if(e.type == 'keypress')

  {

Code  = e.keyCode;

bool = e.shiftKey;

tabBackorFront(text,current,next,previous,contact_type,detailed_type);

  }

}

 

My aim on this function is to select which function must be selected after an event has been invoked.

 

function  tabBackorFront(text,current,next,previous,contact_type,detailed_type)

{

  to be selected on any pressed

}

 

function ShowNext(text,current,next,previous,contact_type,detailed_type)

{

  to be selected onblur of the textbox

}

the problem is that both of this events are called onblur of the input text when a tab is clicked.Can anyone help me on reading these two events @ the same time                                                                                                                   

         

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.