How would I disable a button?
Moderator: General Moderators
How would I disable a button?
I have a series of radio boxes on a php page. Depending on some conditions, I'm disabling them or enabling. With this, a situation may arise where all the radio boxes are disabled. How would I disable the submit button when all the radio buttons are disabled?
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Got it!
Thank You 
Code: Select all
<script language="javascript">
window.onload = function(){
var count1;
count1 = 0;
for(i=0;i<document.course.course_id.length;i++) {
if(document.course.course_id[i].disabled == true)
count1++;
}
if(count1 == document.course.course_id.length)
document.course.course.disabled=true;
}
</script>