Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Re: onBlur, on Focus events


Message #1 by google s <googlesxyz@y...> on Mon, 13 Aug 2001 05:59:57 -0700 (PDT)
Hello everybody,

      I need help on javascript function.
I wrote two functions for calling onblur and onfocus
events in the text box.
(please review the script below)


it's working fine for only one text box.
But, I want to use this function more than one text
box.

If you Could  please help me out, that would be nice.

Thanks in advance.




here is my script follows:

<script language="javascript">
function lostfocus()
{
document.frm.text2.style.background='white'

document.frm.text2.style.color='black'
}

function setfocus()
{

document.frm.text2.style.background='blue';
document.frm.text2.style.color='black'


}

</script>

</HEAD>
<BODY>
<form name=frm>

<INPUT type="text" id=text2 name=text2
onfocus="setfocus()" onBlur="lostfocus()">
<INPUT type="text" id=text3 name=text3>
<P> </P>
<INPUT type="submit" value="Submit" id=submit1
name=submit1>

<INPUT type="reset" value="Reset" id=reset1
name=reset1>

</form>
</BODY>

Could you please help me if anybody knows.

Thanks for all your cooperation.



  Return to Index