davidrobin Posted May 18, 2005 Posted May 18, 2005 I have a dynamically created HTMLInputText HTMLControl. I have some javascript I want to call <script language="javascript"> <!-- function gohere(){ if (document.getElementById('Text1').value == 'L') {document.getElementById('Select1').style.display = 'none'} else {document.getElementById('Select1').style.display = ''} } //--> </script> The code for creating the HTMLInputText control is this tbcCell = New TableCell Dim txtMarkBox As New HtmlInputText txtMarkBox.ID = "HTMLMark" & i.ToString txtMarkBox.EnableViewState = True txtMarkBox.MaxLength = 1 tbcCell.Controls.Add(txtMarkBox) tbrRow.Cells.Add(tbcCell) How do I tell the HTMLInputText control to call the javascrtipt on the onblur event? Quote
kahlua001 Posted May 18, 2005 Posted May 18, 2005 txtMarkBox.Attributes.Add("onBlur","gohere()") Quote
davidrobin Posted May 18, 2005 Author Posted May 18, 2005 txtMarkBox.Attributes.Add("onBlur"' date='"gohere()")[/quote'] That is pretty straight forward, I will put it in and see how it goes. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.