JavaScript verification- Numeric input and check box question

Dear All,

I have a grid question in a free format where we would like respondents to input a numeric input and for their convenience we would like also to enable a single check box in the same row - to tick if no input to numeric input is required.

I would like to avoid a situation when respondents don't answer to any of the question - not numeric nor check box. For the verification of the answer I probably need a javascript code , here is my try but it doesn't work for some reason. Can somebody help ?
Thanks a lot !
Robson


var GOLD1=SSI_GetValue('Q19ff_GOLD1'); // this is numeric input
var notchange_gold1=SSI_GetValue('q19_ff_select1'); // this is check box
var GOLD2=SSI_GetValue('Q19ff_GOLD2'); // this is numeric input
var notchange_gold2=SSI_GetValue('q19_ff_select2'); // this is check box



if(GOLD1>0 && notchange_gold1==1)
{
strErrorMessage = "You cannot input number to column 1 and select "will not change" at the same time";
}

if(GOLD1==0 && notchange_gold1==0)
{
strErrorMessage = "Please answer to Row 1 ";
}


if(GOLD2>0 && notchange_gold2==1)
{
strErrorMessage = "You cannot input number to column 1 and select "will not change" at the same time";
}

if(GOLD2==0 && notchange_gold2==0)
{
strErrorMessage = "Please answer to Row 2";
}

Resolved
4 replies