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
https://forums.phpfreaks.com/topic/166289-javascript-events/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.