Missing value
Posted: 16 May 2017
Hi
I'm checking if some of the fields in the choice menu are selected and if nu. xx or xx is selected then is obligatory to fill lookup field.
The check is working, but if you open the edit form - the value in look up field is not visible.
The code is on Save button. Without the code the value is visible - so I think that is something wrong with the code.
Can you chek it? Thanks
var inp = document.getElementsByClassName("ChiiceField")(0).getElementsByClassName("fd_control")(0).getElementsByTagName("input");
var result = [];
for(var i = 0; i < inp.length ; i++)
{
if(inp(i).checked)
{
result.push("x" + i);
var ReIzbrani = (((document.getElementById(cslLookUpField)).getElementsByClassName("select2-choice")(0)).getElementsByTagName('span')(0)).innerHTML;
if(i==8 || i==12 || i==13 || i==14){
if (ReIzbrani == " "){
alert( "Missing Lookup Field");
return false;
}
}
}
};
if(result.length == 0)
{
alert( "one of field has to be check!");
return false;
};
I'm checking if some of the fields in the choice menu are selected and if nu. xx or xx is selected then is obligatory to fill lookup field.
The check is working, but if you open the edit form - the value in look up field is not visible.
The code is on Save button. Without the code the value is visible - so I think that is something wrong with the code.
Can you chek it? Thanks
var inp = document.getElementsByClassName("ChiiceField")(0).getElementsByClassName("fd_control")(0).getElementsByTagName("input");
var result = [];
for(var i = 0; i < inp.length ; i++)
{
if(inp(i).checked)
{
result.push("x" + i);
var ReIzbrani = (((document.getElementById(cslLookUpField)).getElementsByClassName("select2-choice")(0)).getElementsByTagName('span')(0)).innerHTML;
if(i==8 || i==12 || i==13 || i==14){
if (ReIzbrani == " "){
alert( "Missing Lookup Field");
return false;
}
}
}
};
if(result.length == 0)
{
alert( "one of field has to be check!");
return false;
};