<body bgColor="#ffffff" background="./images/testbg.gif" style="margin-top:0" MS_POSITIONING="GridLayout" [b]onload="sf()"[/b]>
'insert missing tags in the default markup
Private Function FixMarkup(ByVal gridMarkup As String) As String
'local variables
Dim StrScript As String
[b] If rbtnNameSearch.Checked = True Then
StrScript = "function sf()" _
& " { " _
& " document.Form1.txtName.focus(); " _
& " }"
Else
StrScript = "function sf()" _
& " { " _
[u] & " document.Form1.txtFileNumber.focus(); " _[/u]
& " } " _
& "function validateRange(source,Args){" _
& "if (Args.Value > 999 && Args.Value < 999999)" _
& " Args.IsValid = true;" _
& "else" _
& " Args.IsValid = false;" _
& " return;" _
& "}"[/b]
End If
'find the 1st occurrence of <head> and insert <link href="MainCss.css" type="text/css" rel="stylesheet">
Dim insertpoint As Integer
insertpoint = gridMarkup.IndexOf("language=""javascript"">") + ("language=""javascript"">").Length
gridMarkup = gridMarkup.Insert(insertpoint, StrScript)
Return gridMarkup
End Function
<script src="Scripts/jquery-1.12.1.min.js"></script>
<script type="text/javascript">
$(function () {
$("#txtName").focus(function () {
alert("hello world");
})
})
</script>
<script type="text/javascript" >
$(document).ready(function () {
$("#txtName").focus();
});
</script>
<script type="text/javascript" language="javascript">
function TestFocus() {
// Reference the textbox
var txt = document.getElementById("<%=txtName.ClientID%>");
// If the textbox was found, call its focus function
if (txt != null)
txt.focus()
else
alert("Nothing here");
}
</script>
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE