I’m struggling to figure out how to change the css class of a submit button when toggling between two radio buttons. I've searched for examples but haven't found one that fits my needs. Can anyone offer some assistance?
Below is my form:
<form class="orderform">
<input type="radio" name="choice" id="out" value="140" checked> <label for="out">I want A</label>
<input type="radio" name="choice" id="in" value="40"> <label for="in">I want B</label>
<input type="submit" value="Save changes" class="submit-btn-disabled" disabled="disabled">
</form>
The default appearance of the submit button should be as shown above (class="submit-btn-disabled"). When enabled, it should display with the class "submit-btn", along with a hover effect:
<input type="submit" value=" Save changes" class="submit-btn">
Here are the corresponding CSS classes:
input.submit-btn-disabled{
-webkit-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
-webkit-border-radius: 0em;
-moz-border-radius: 0em;
border-radius: 0em;
border: none;
background-color: #c4daaa;
padding: 0.8em;
font-size: 0.8em;
color: #fff;
cursor: pointer;
margin-top: 1em;
}
input.submit-btn{
-webkit-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
-webkit-border-radius: 0em;
-moz-border-radius: 0em;
border-radius: 0em;
border: none;
background-color: #3A7B30;
padding: 0.8em;
font-size: 0.8em;
color: #fff;
cursor: pointer;
margin-top: 1em;
}
input.submit-btn:hover{
background-color: #82bc00;
}