-5

can anyone help me how to turn on and off using a button.

enter image description here

current code:

<form>
<input type="button" value="one" disabled />
<input type="button" value="two"  />
</form>
xplody
  • 103
  • 1
  • 13

1 Answers1

1

You will need to use JavaScript. My example uses jQuery. The other examples cited are a little more complicated, so I made this for you.

// find the elements
var $form = $('form');
var $buttons = $form.find('input[type=button]');

// event logic
$buttons.click(function(e) {
  $buttons.attr('disabled', false);
  $(this).attr('disabled', true);
});

Put this in the onload or DomReady handler on your page. Check out the fiddle if you want: http://jsfiddle.net/G5e48/

adu
  • 947
  • 1
  • 8
  • 15