0
I have a button that needs to be enabled when the user finishes filling the fields, but it needs to be changed the class when it is enabled...
when the button is disabled I would need that while the fields are not filled the button stay in satus disabled and with the gray css class, after being filled the fields the button is enabled and with the green css class, that would be in jQuery? How do I make it work?
.btn-pdf {
text-align: center;
float: right;
margin: 0 5px;
}
.btn-pdf .fa-thumbs-down {
background-color: #f3f3f3;
color: #787878;
padding: 20px;
border-radius: 50px;
}
.btn-pdf .fa-thumbs-down:hover {
background-color: #fbfbfb;
transition: 0.2s;
}
.btn-pdf .fa-thumbs-up {
background-color: #59bd59;
color: #FFFFFF;
padding: 20px;
border-radius: 50px;
}
.btn-pdf .fa-thumbs-up:hover {
background-color: #68cb68;
transition: 0.2s;
}
.btn-pdf a {
text-align: center;
font-family: 'KG Blank Space Solid';
color: #303030;
font-size: 13px;
}
.btn-pdf a:hover {
text-decoration: none;
}
<form id="msform" method="post">
<div class="form-group">
<label>Telefone Válido*</label>
<input id="celular" type="text" class="form-control" name="celular" placeholder="Telefone">
</div>
<div class="form-group">
<label>Selecione uma Opção</label>
<select class="form-control" id="list-lugar" name="unidade">
<option value="0" disabled="true" selected="true">Selecione uma Unidade</option>
<option name= "PMA" value="200">Shopping 1</option>
<option name = "BRB" value="200">Shopping 2</option>
</select>
</div>
</form>
<div class="btn-pdf">
<a href="">
<i class="far fa-thumbs-down fa-2x"></i><br>Baixar PDF
</a>
</div>
<div class="btn-pdf">
<a href="">
<i class="far fa-thumbs-up fa-2x"></i><br>Baixar PDF
</a>
</div>
here’s a great example: http://jsfiddle.net/p628Y/1/ on style, I think it’s easier to leave the
css
resolve. If you apply the attributedisabled
on the link, just use the selectora:disabled
to apply the style you want when disabled– Ricardo Pontual