I have a page made with bootstrap 3 where I show some fields coming from my DB, now when opening the page I need all fields except for a Iniciar Tarefa
to be disabled, the Iniciar Tarefa
button will be responsible for enabling the fields for editing.
I'm trying to use this, but to no avail:
$(document).READY(function() { // PARA HABILITAR OS CAMPOS DO FORMULÁRIO, MUDAR O true PARA false $("#form :input").prop("disabled", true); // DESABILITA TODOS OS CAMPOS });
The form is this:
<form class="form-horizontal">
<!-- Form Name -->
<legend>Atividade</legend>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="IniciarTarefa"></label>
<div class="col-md-4">
<button id="IniciarTarefa" name="IniciarTarefa" class="btn btn-info">Iniciar Tarefa</button>
</div>
</div>
<!-- Select Basic -->
<div class="form-group">
<label class="col-md-4 control-label" for="Etapa">Etapa</label>
<div class="col-md-4">
<select id="Etapa" name="Etapa" class="form-control">
<option value="1">Opção 1</option>
<option value="2">Opção 2</option>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="Ordem">Ordem</label>
<div class="col-md-4">
<input id="Ordem" name="Ordem" type="text" placeholder="Ordem" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="Nome">Nome</label>
<div class="col-md-4">
<input id="Nome" name="Nome" type="text" placeholder="Nome" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="LinkDocumento">Link Documento</label>
<div class="col-md-4">
<input id="LinkDocumento" name="LinkDocumento" type="text" placeholder="Link do Documento" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="DataInicio">Data Início</label>
<div class="col-md-4">
<input id="DataInicio" name="DataInicio" type="text" placeholder="Data Início" class="form-control input-md" required="">
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="DataFinal">Data Final</label>
<div class="col-md-4">
<input id="DataFinal" name="DataFinal" type="text" placeholder="Data Final" class="form-control input-md" required="">
</div>
</div>
<!-- Prepended checkbox -->
<div class="form-group">
<label class="col-md-4 control-label" for="Enviar"></label>
<div class="col-md-4">
<div class="input-group"> <span class="input-group-addon">
<input type="checkbox">
</span>
<input id="Enviar" name="Enviar" class="form-control" type="text" placeholder="Enviar E-mail">
</div>
</div>
</div>
<!-- Textarea -->
<div class="form-group">
<label class="col-md-4 control-label" for="Descricao">Descrição</label>
<div class="col-md-4">
<textarea class="form-control" id="Descricao" name="Descricao"></textarea>
</div>
</div>
<!-- Multiple Radios -->
<div class="form-group">
<label class="col-md-4 control-label" for="Status">Status</label>
<div class="col-md-4">
<div class="radio">
<label for="Status-0">
<input type="radio" name="Status" id="Status-0" value="1" checked="checked">
Iniciada </label>
</div>
<div class="radio">
<label for="Status-1">
<input type="radio" name="Status" id="Status-1" value="2">
Finalizada </label>
</div>
<div class="radio">
<label for="Status-2">
<input type="radio" name="Status" id="Status-2" value="3">
Cancelada </label>
</div>
</div>
</div>
<!-- Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="FinalizarTarefa"></label>
<div class="col-md-4">
<button id="FinalizarTarefa" name="FinalizarTarefa" class="btn btn-info">Finalizar Tarefa</button>
</div>
</div>