Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp / javascript checkbox enable/disable issue

Status
Not open for further replies.

NBartomeli

Programmer
Jul 1, 2003
111
US
I have a 4 sets of checkboxes and text boxes on an aspx page. The checkboxes are disabled by default but when the text box next to it has text entered into it, the checkbox is supposed to enable.

The problem is, the value is changed when I step through it in the debugger but the page is not. (checkboxes stay disabled on the page, but the value of checkbox.disabled = false)

If i REVERSE this, making the checkboxes enabled by default and then try to disable them when text is entered, it works fine.

Any suggestions?

my code looks like:
Code:
[COLOR=green]//elemArray[6] has checkbox.ClientID value[/color]
document.forms[0][elemArray[6]].disabled = false;

Thanks for any help
 
sounds like a page.ispostback problem in your page_load.

make sure your [if not page.ispostback] is around your initial code in the page_load.

Good Luck.
 
This is actually a javascript call which is trying to manipulate an asp:checkbox item. There is no postback done when the action occurs.

My problem is, if I change this code to have the checkbox go from ENABLED to DISABLED it works fine. But when I change the code to have it do the opposite (dissabled at load, enabled when value changed) it doesn't work.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top