Changing the textbox color dynamically

Changing the text box styling dynamically using java script.


< script >
function txtBr(Recid)
{
if(Recid==0)document.getElementById ("Text1").style.border ='0px';
if(Recid==1)document.getElementById ("Text1").style.border ='1px';
if(Recid==1)document.getElementById ("Text1").style.borderStyle='solid';
if(Recid==1)document.getElementById ("Text1").style.borderColor ='red';
if(Recid==1)document.getElementById ("Text1").style.backgroundColor='yellow';
if(Recid==1)document.getElementById ("Text1").focus();
}
< /script >
< /head >
< body onload ="txtBr(0);" >
< form id="form1" runat="server" >

< input id="Text1" type="text" runat ="Server" onmousemove ="txtBr(1);" / >



Comments

Popular posts from this blog

Maximize child MDI form without ControlBox

Adding text to label using javascript

Get Text Height & Width