Click to See Complete Forum and Search --> : Enable Radio Button Group and Function
jamal464
12-27-2003, 04:18 AM
Hi there
I'm just new to javascrip and i want to know some info about function's
1. I have to function's and i want to call them both whin i press the rdio button
2. I have 3 group's from radio button so when the user click an radio button of group1 then all radio button's on group1 will be disabled and so on for the other group's
So how to Enabled them all with a Push Button
Code
<input type="button" value="Enable" onClick="disableGroup(this.form, 'grp1', false)">
Thank's
Do you mean something like this?
<script>
function chkme(n){
for(i=0;i<5;i++){
if(document.f1.elements["r"+n][i].checked==true){
for(j=0;j<5;j++){
document.f1.elements["r"+n][j].disabled=true
}
}
}
}
</script>
<form name="f1">
<input type="radio" name="r1" onclick="chkme(1)">
<input type="radio" name="r1" onclick="chkme(1)">
<input type="radio" name="r1" onclick="chkme(1)">
<input type="radio" name="r1" onclick="chkme(1)">
<input type="radio" name="r1" onclick="chkme(1)">
<P>
<input type="radio" name="r2" onclick="chkme(2)">
<input type="radio" name="r2" onclick="chkme(2)">
<input type="radio" name="r2" onclick="chkme(2)">
<input type="radio" name="r2" onclick="chkme(2)">
<input type="radio" name="r2" onclick="chkme(2)">
<P>
<input type="radio" name="r3" onclick="chkme(3)">
<input type="radio" name="r3" onclick="chkme(3)">
<input type="radio" name="r3" onclick="chkme(3)">
<input type="radio" name="r3" onclick="chkme(3)">
<input type="radio" name="r3" onclick="chkme(3)">
</form>
jamal464
12-27-2003, 02:53 PM
Thank's Mr J
Yes that what i ment
And now i want to know how to Enabled them all the 3 groups with just a click of Push Button
Please try the following
<script>
function chkme(n){
for(i=0;i<5;i++){
if(document.f1.elements["r"+n][i].checked==true){
for(j=0;j<5;j++){
document.f1.elements["r"+n][j].disabled=true
}
}
}
}
function enable_buttons(){
for(i=0;i<document.f1.length;i++){
if(document.f1.elements[i].type=="radio"){
document.f1.elements[i].checked=false
document.f1.elements[i].disabled=false
}
}
}
</script>
<form name="f1">
<div onclick="chkme(1)">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
<input type="radio" name="r1">
</div>
<P>
<div onclick="chkme(2)">
<input type="radio" name="r2">
<input type="radio" name="r2">
<input type="radio" name="r2">
<input type="radio" name="r2">
<input type="radio" name="r2">
</div>
<P>
<div onclick="chkme(3)">
<input type="radio" name="r3">
<input type="radio" name="r3">
<input type="radio" name="r3">
<input type="radio" name="r3">
<input type="radio" name="r3">
</div>
<P><input type="button" onclick="enable_buttons()" value="Enable All Radios">
</form>
jamal464
12-28-2003, 04:06 AM
Thank's Mr J
It work
jamal464
01-10-2004, 12:56 AM
Hi
One more Q
Whin i hit the Refresh Button it will Enabled all the radio's is there any way to disabled the Refresh Button in the toolbar
Or any slution to this
Thank's
I'm not sure if that can be done.
Do a search in this forum for "refresh button" or words to that effect and see what comes up
Pittimann
01-10-2004, 07:26 AM
Hi!
Even if it was possible to disable the refresh button (which is not, provided that your window is not a popup without the toolbar being displayed), you would have to prevent the user from clicking the refresh option in the context menu (by disabling right click - you can also perfom a search for that) or simply to use the keyboard command for refreshing...
Cheers - Pit