i have something like this. In a page i'll be displaying a set of questions retrieved from the backend all with answers
as radio button choices yes or no. The number of questions generated may vary.so i used the question ID as name for the respective radiobuttons.When i click on submit answers
i want to check whether any question has been left unanswered(no default checked value).if so the alert is shown.In the below function i have first retrieved the count of questions and in a loop trying to check the values of the radio buttons. Since the name of radio buttons are 1,2,3.... like that i 'm using
f.i.value.But i is a number.so i cant use it. How to convert this value of i to string??
function subvalue1(f)
{
var io=f.Count.value;
for(i=1;i<=io;i++)
{
var val=f.i.value;
if(val == "" || val == null){
alert (" Please answer all the Questions"
;
f.focus();
return false;
}
}
}
as radio button choices yes or no. The number of questions generated may vary.so i used the question ID as name for the respective radiobuttons.When i click on submit answers
i want to check whether any question has been left unanswered(no default checked value).if so the alert is shown.In the below function i have first retrieved the count of questions and in a loop trying to check the values of the radio buttons. Since the name of radio buttons are 1,2,3.... like that i 'm using
f.i.value.But i is a number.so i cant use it. How to convert this value of i to string??
function subvalue1(f)
{
var io=f.Count.value;
for(i=1;i<=io;i++)
{
var val=f.i.value;
if(val == "" || val == null){
alert (" Please answer all the Questions"
f.focus();
return false;
}
}
}