Textbox - additional features?

R

Rob T

I'm dynamically creating some textboxes but also need to add some javascript
into them. What properties do I use to do this?

txtTextBox = New TextBox
txtTextBox.ID = "CAS" & dv(cnt)("InvID")
txtTextBox.Text = dv(cnt)("Cash")
txtTextBox.Columns = 9
plhResults.Controls.Add(txtTextBox)

I need to add: onfocus="DoMyFunc();"

Thanks.
 
W

William F. Robertson, Jr.

Add the function to the attribute collection.

txtTextBox.Attributes.Add( "onfocus", "javascript: DoMyFunc();" );

HTH,

bill
 
S

Shiva

txtTextBox.Attributes.Add ("onFocus", "DoMyFunc();")

I'm dynamically creating some textboxes but also need to add some javascript
into them. What properties do I use to do this?

txtTextBox = New TextBox
txtTextBox.ID = "CAS" & dv(cnt)("InvID")
txtTextBox.Text = dv(cnt)("Cash")
txtTextBox.Columns = 9
plhResults.Controls.Add(txtTextBox)

I need to add: onfocus="DoMyFunc();"

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top