3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by KcNaveen
0

Yes, but you need to use 'onSubmit' in the form tag to change the radio button to be disabled. A sample code is below...

<html>
<head>
  <script type="text/javascript">
  function demo(form) {
    var rads = form.radd
    for (var i=0; i<rads.length; i++) {
      rads[i].disabled = true
    }

    return true
  }
  </script>
</head>
<body>
  <form action="200.html" onsubmit="return demo(this)">
    <input type="radio" name="radd" value="rad1">Radio1
    <input type="radio" name="radd" value="rad2">Radio2
    <input type="radio" name="radd" value="rad3">Radio3
    <input type="radio" name="radd" value="rad4">Radio4
    <br><br>
    <input type="submit" value="Go Ahead">
  </form>
</body>
</html>

The code assume that the next page is going to be 200.html...

Edited by Taywin: n/a

0

Yes it is possible to make the radio button disabled using javascript but the problem will be that the radio button's value wont be submitted to server if it is disabled. You will have to use some hidden fields to pass the value to the server

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.