Jump to content

wts the problem?


jeeva

Recommended Posts

his frnds,

 

i have a survey form.In that i need to validate  the radio button.For that i have coded one javascript code

but its not working properly. its keep telling the the alert message even if the answer are checked

 

here that code

function validate(formname)
{

for (var i = 1; i <= formname.numQtns.value; i++) {
      radioGroup = document.getElementById('Q' + i);
         

if(!radioGroup.checked){       
            alert('Please answer all questions before submitting.'+i);
             return false;
		 			          }
     }

can u tell me wts the problem with this code?

Link to comment
https://forums.phpfreaks.com/topic/41405-wts-the-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.