On keypress event using javascript

Posted by Venkatesh under JavaScript on 11/30/2010 | Points: 10 | Views : 2551 | Status : [Member] | Replies : 1
Hi,

How to add " " onkeypress event using javascript
example: if i type "Welcome to Dotnetfunda"
but Onkeypress event add   like if see in viewsource
like this  "Welcome to Dotnerfunda"

How to do this

Thanks




Responses

Posted by: T.saravanan on: 11/30/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi Venkatesh,

on keypress event..
check textbox value is empty or not..


function GetData()
{
var txtCntrl = document.getElementById('<%=txtValue.ClientID%>');
if(txtCntrl.value !='')
{
txtCntrl.value = "&nbsp;" + txtCntrl.value;
}
}


you can change the code for yourself...


Thanks,
T.Saravanan

Venkatesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response