Hi Karl.
I agree with you but for something I could not discover, the code only
works if I set the focus on the textboxes.
See, I have this server code to generate the onblur for the textboxes:
Private Sub repVist_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs) Handles
repVist.ItemDataBound
Dim txtTime As TextBox
Dim objButton As Button
If e.Item.ItemType = ListItemType.Item OrElse _
e.Item.ItemType = ListItemType.AlternatingItem Then
Dim strRow As String = e.Item.ClientID & "_newrow"
txtTime = DirectCast(e.Item.FindControl("txtRowData"),
TextBox)
If Not txtTime Is Nothing Then
With txtRestante.Attributes
Dim intSla As Integer = CInt(.Item("sla"))
.Add("fTimer", "true")
.Add("onblur",
"setClock(document.Form1,this,this.value,this. id," & strRow & "," &
intSla.ToString & ");")
End With
End If
objButton = DirectCast(e.Item.FindControl("cmdCancel"),
Button)
If Not objButton Is Nothing Then
Dim id As String =
objButton.Attributes.Item("id").ToString
objButton.Attributes.Add("onclick",
"javascript
:window.open('Justnew.aspx?id=" & id & "&mon=true','" &
id.Trim & "','width=500,height=350,status=yes'); return false;};")
End If
End If
End Sub
And I have that client code called on page load, to start the clocks:
function iniciaTimer()
{
var e = document.Form1.elements;
var n = e.length;
var i;
for(i=0;i<n;++i)
{
if (e[i].getAttribute('fTimer') != null)
{
e[i].focus();
//e[i].blur();
e[i].readOnly=true;
}
}
document.getElementById('cmdReturn').focus();
}
If I comment the line that set the focus and leave the line that
executes the blur() function, the code doesn't run.
Can you see something wrong here?
Thanks,
Chris Leffer
*** Sent via Developersdex
http://www.developersdex.com ***