Manipulating a button based on readonly attribute of a check box

J

Jack

Hi,
I have a asp page where a checkbox, when clicked will disable all text boxes
associated with the page.

The following is a part of a code for the checkbox with its name and
readonly attributes.
name="chk_Complete" <%= isReadOnly %>

I have to disable(or make sure does not disaplay) a save button in the same
page when this checkbox's attribute is readonly. I have no idea how to do
this.
I need some help/idea to handle this issue. Thanks.
 
J

JitGanguly

Are you trying to do it on server side ? I think you want client side for
that your code is not right.
You need something like

So for series of checkboxes, you want to write a function that would do it
like
<html>
<body>
<form name=form1>
<input type=checkbox name="aaa" value="aaa">
<input type=checkbox name="bbb" value="bbb">
<input type=button value="Disbale" onclick=disableall()>
</form>
</body>
</html>
<script>
function disableall()
{
document.form1.aaa.disabled=true
document.form1.bbb.disabled=true
}
</script>
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top