2
I have a project where I’m using Mvccheckboxlist. My question is this::
- Could I put a mvccheckboxlist together with radio Buttons and inputs ? Because I am in a project at a school that I have to record some occurrences and I need that in these occurrences, when marking a check box, an input appears, but only in some. Explaining better, it would be the radio Buttons for the type of occurrence (Warning or Suspension) and the mvccheckboxlist for the causes (mess, swearing, etc.) and when choosing some causes appear a text input to complement. That is, relate the radio button to the check box. And after that I recover, edit, delete and add other occurrences. Remembering here that I already used the mvccheckboxlist, but I do not know how to record their values in the bank, and I already have the model of Student, which makes the register of students. In case of occurrence I would have to create another table ?
Anyway, I’m going to post the html code here, so you have an idea of how I wanted it to look:
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#ocorrencias">
Ocorrências do Aluno
</a>
</h4>
</div>
<div id="ocorrencias" class="panel-collapse collapse in">
<div class="panel-body">
<div class="radio-inline">
<label class="radio-inline">
<input type="radio" value="Advertencia" id="Advertencia" />
Advertência
</label>
<label class="radio-inline">
<input type="radio" value="Suspensao" id="Suspensao" />
Suspensão por: <input type="text" class="col-xs-1" name="dias" id="dias"/> dias.
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="atividade" id="atividade" value="" checked>
Estar deixando de fazer as atividades discentes ou não ter concluido a mesma
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="material" id="material" value="">
Não trazer o material necessario para as aulas do dia
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="uniforme" id="uniforme" value="">
Não estar devidamente uniformizado
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="conversa" id="conversa" value="">
Estar conversando excessivamente em sala de aula
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="atrapalhando" id="atrapalhando" value="">
Estar brincando e atrapalhando os colegarr em sala de aula
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="atividadesDocentes" id="atividadesDocentes" value="">
Estar impedindo as atividades docentes
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="brincando" id="brincando" value="">
Estar com brincadeira de mau gosto na escola <input type="text" name="motivo" id="motivo"/>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="aula" id="aula" value="">
Estar frequentemente "matando aula" ou chegando atrasado
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="fugindo" id="fugindo" value="">
Ter saído da escola sem autorização, fugiu ás <input type="text" name="hora" id="hora"/>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="foraDeSala" id="foraDeSala" value="">
Estar fora da sala de aulas <input type="text" name="fora" id="fora"/>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="agredido" id="agredido" value="">
Ter agredido, faltado com o devido respeito aos colegas <input type="text" name="respeito" id="respeito" />
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="respeito" id="respeito" value="">
Ter faltado com respeito ao professor
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="equipamentos" id="equipamentos" value="">
Estar usando equipamentos eletro-eletrônicos em sala de aula <input type="text" name="equipamentos" id="equipamentos" />
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" name="outros" id="outros" value="">
Outros <textarea name="outros" id="outros"></textarea>
</label>
</div>
<div class="form-group">
<input type="submit" value="Salvar" class="btn btn-success" />
</div>
</div>
</div>
If you need more information, I put here, model or controller to make it clearer.
Do you only want to show the text? Each text is linked to a property in the model?
– Tiedt Tech
What happens is that I haven’t even created the occurrences model yet, because I don’t know how to relate this occurrences model to the student model. And wanted to record, edit, list and remove these occurrences without the student’s data being affected !
– Érik Thiago