Jump to content

help me get this woking..


php_novice2007

Recommended Posts

Hi,

 

I've got the following code:

 

HTML:

<form name="myform1" action="b.php" method="POST">
<input type=radio checked name="CommandType" onclick="radioclick0();" value="0">Normal Command
<input type=radio name="CommandType" onclick="radioclick1();" value="1">Put in Recovery Mode

<input type="text" size=10 name=log_int value=5><br>
</form>

 

JS:

function radioclick0() {
  document.myform1.log_int.disabled = "no";
}
          
function radioclick1() {
  document.myform1.log_int.value = "0";
  document.myform1.log_int.disabled = "yes";
} 

       

 

When the form is loaded, things are fine, as soon as I click on a radio button, the field is disabled, doesn't matter which button I click....

 

How do I fix it?

 

Thanks~!

Link to comment
https://forums.phpfreaks.com/topic/67176-help-me-get-this-woking/
Share on other sites

This:

function radioclick0() {

  document.myform1.log_int.disabled = "no";

}

         

function radioclick1() {

  document.myform1.log_int.value = "0";

  document.myform1.log_int.disabled = "yes";

}

should be

function radioclick0() {
  document.myform1.log_int.disabled = false;
}
          
function radioclick1() {
  document.myform1.log_int.value = "0";
  document.myform1.log_int.disabled = true;
} 

It worked in FF for me.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.