Code for highlight the text in textbox using javascript

Posted by Arun.padmanaban under JavaScript on 6/13/2011 | Points: 10 | Views : 5365 | Status : [Member] | Replies : 3
i have 2 textbox and ,textbox1 for searching the text which is in present in textbox2 and search button is used to highlight the searched text in textbox2




Responses

Posted by: Robin_ahuja2008 on: 6/15/2011 [Member] Starter | Points: 25

Up
0
Down
Please check the link
http://james.padolsey.com/javascript/highlighting-text-with-javascript/

Regards,
Robin Ahuja

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

Posted by: Susanthampy on: 6/15/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<script type="text/javascript">
<!--
function highlightTextBox()
{
document.getElementById('<%= TextBox1.ClientID %>').focus();
document.getElementById('<%= TextBox1.ClientID %>').select();
}
// -->
</script>




Regards,
Susan

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

Posted by: Susanthampy on: 6/15/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Also try this,

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ValidatorCallout/ValidatorCallout.aspx

Regards,
Susan

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

Login to post response