document.getElementById('myinput').createTextRange ().find('text to select');
Thank you . I'm trying the below and getting OBJECT EXPECTED error in
javascript.
on my aspx page I have this:
<script language="javascript" type="text/javascript">
function SearchText(selectit)
{
document.getElementById('TextBox_Body').createText Range().find(selectit);
}
</script>
In a class called pkb I have this function:
Public Function SelectText(ByVal SearchString As String) As String
Return "<script language='JavaScript'>" + vbCrLf +
"SearchText('" + SearchString + "')" + vbCrLf + "</script>"
End Function
and attempting to call the javascript like this:
ClientScript.RegisterClientScriptBlock(Me.GetType, "client",
pkb.SelectText(TextBox_Search1.Text))
If rightclick view source on the page and do see that the textboxes ID
is TextBox_Body
If I step through the code, the dynamic javascript looks like this
when passed the string car:
<script language='JavaScript'>
SearchText('car')
</script>
Also, once I get past this, will i be able to select more than one
string or repeating strings? Also how can I make this not care about
case?
Thanks for any help or information.