Copy link to clipboard
Copied
Not sure if that is the rigth title for this.. but is something like what I need to do, but I'm completely new on this and have low knowledge on JS, so I hope you can help.. this is the matter..
I have the following form (also attached)
And what I need is.. On the values for "dias a disfrutar" which are 3 boxes.. be related to the checkbox above of "Dias de vacaciones" So, if I checked the option "15 días" I need that the boxes of "dias a disfrutar"doesn't allowme to input more than 15 days.. and if I select "18 dias" let me put no more than the 18 and so the same for 21.. I have no idea where to put the code or how to code it.. I saw a few topics in the group and found some codes related but nothing that I can use.. So I collected something like the code below.. but I'm not sure if I can use or not or how to use it LOL!
var diasDeVacacionesJunior = 15;
var diasDeVacacionesSenior = 18;
var diasDeVacacionesEjecutivo = 21;
var diasAcumulados = 0;
var diasADisfrutar1 = "input field";
var diasADisfrutar2 = "input field;
var diasADisfrutar3 = "input field";
if ( diasAcumulados + diasADisfrutar.value > diasDeVacacionesJunior) {
event.value = 0;
// Show a message that's not possible
return false;
} else {
// Let it move forward
diasAcumulados += event.value;
return true;
}
*/
Have something to add?