I have three checkboxes which are shown on my screen and I want them to be selected by default when they enter my screen if their field that fills it with base has the value of 1
<inpunt type="checkbox" id="checkName1" name="checkName1" />
<inpunt type="checkbox" id="checkName2" name="checkName2" />
<inpunt type="checkbox" id="checkName3" name="checkName3" />
I have the following method in my controller that retrieves data from the base and with that data I get the values of the fields to fill the checks
public String metodoPrimero(Model model){
AnalisisServicio informeAnalisis = analisisService.consultaAnalisis(servicioForm.getIdServicio());
model.addAtributte("informeAnalisis", informeAnalisis);
return Constantes.PANTALLA_INICIO;
}
and I retrieve that data in the following way in my jsp
<inpunt type="hidden" id="checkName1Hidden" name="checkName1Hidden" value="${informeAnalisis.checkPrimero}"/>
<inpunt type="hidden" id="checkName2Hidden" name="checkName2Hidden" value="${informeAnalisis.checkSegundo}"/>
<inpunt type="hidden" id="checkName3Hidden" name="checkName3Hidden" value="${informeAnalisis.checkTercero}"/>
and I have the following function to validate and show the checks selected if their value equals 1
function obtenerValores(){
var check1 = $("#checkName1Hidden").val();
var check2 = $("#checkName2Hidden").val();
var check3 = $("#checkName3Hidden").val();
if(check1 ==1){
$("#checkName1").prop('checked', true);
}
if(check2 ==1){
$("#checkName2").prop('checked', true);
}
if(check3 ==1){
$("#checkName3").prop('checked', true);
}
}
and when I enter my screen and choose a service through a combo, the info is loaded and the selected checks appear if they meet the condition, but when I change the option in the combo, or choose another service , send me the following error:
Error 400- Bad Request
From RFC 2068 Hypertext Transfer Protocol-HTTP
The request could not be understood by the server due to malformed syntax.
The client should not repeat the request without modifications.
and I have no idea what is due, could someone help me? What is wrong? I hope you can help me, thanks