By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

asp Checkbox on click event

P: n/a
I have a simple problem but after an afternoon of searching still cant
get a solution.

I have an asp checkbox on my form that i want to, when checked, enable
a textbox. when the checkbox is unchecked the textbox becomes disabled
again. i want to use some client side script as i dont want to always
post back for such a trivial thing. how would you create a java
function to disable the text box when the checkbox is checked and how
would you link the checkbox to the javafunction. i know nothing about
Java script

any ideas??

Feb 22 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<asp:checkbox ...
onclick="document.getElementByIs('myTextBox').disa bled=!this.checked" ...

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Phils" <ph********@iresponse.co.ukwrote in message
news:11**********************@v33g2000cwv.googlegr oups.com...
>I have a simple problem but after an afternoon of searching still cant
get a solution.

I have an asp checkbox on my form that i want to, when checked, enable
a textbox. when the checkbox is unchecked the textbox becomes disabled
again. i want to use some client side script as i dont want to always
post back for such a trivial thing. how would you create a java
function to disable the text box when the checkbox is checked and how
would you link the checkbox to the javafunction. i know nothing about
Java script

any ideas??

Feb 22 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.