View: Form content
{{Form::label('dipno', 'No')}}
{{Form::radio('diploma','No',['id'=>'dip','onclick'=>'hasNoDip();'])}}
{{Form::number('diplomamarks','',['class' => 'form-control','max'=>'100','step'=>'0.01','id'=>'abc'])}}
JavaScript
This is the JavaScript code
<script>
function hasNoDiploma() {
document.getElementById('abc').disabled=false;
return true;
}
</script>
I have added the script tag below in the form blade. (I have tried adding it in the separate JS file and then linked it in my blade template still it was not working)
But the onclick function is not working. Is there another method to achieve this, or have I done something wrong?
What I want to achieve by this code is when I select the radio button a form field in the bottom should be hidden and vice versa.