function clearradio()
{
	var all = document.getElementsByTagName("input");
	for( var i = 0; i<all.length; i++)
	{
		all[i].checked = false;
	}
}

function validate()
{
	
}
function changeTable()
{
	var newTable = document.getElementById('QuestionSet2');
	var oldTable = document.getElementById('QuestionSet1');
	var buttonText = document.getElementById('buttonspan');
	var x = document.getElementById('pr');

	if(buttonText.innerHTML == "NEXT")
	{
		newTable.style.display="inline";
		oldTable.style.display="none";
		buttonText.innerHTML ="FINISH";

		pr.style.width ="50%";
		pr.innerHTML = "50%";
	}
	else
	{
		if(buttonText.innerHTML == "FINISH")
		{
			pr.style.width ="100%";
			pr.innerHTML = "100%";

			alert("Load");
			buttonText.innerHTML ="FINISHED";
		}
	}

}


@@ -166,165 +166,70 @@
 %0A%7B%0A%09
-%0A%7D%0Afunction changeTable()%0A%7B%0A%09var newTable = document.getElementById('QuestionSet2');%0A%09var oldTable = document.getElementById('QuestionSet1');%0A%09var buttonText
+var buttonText = document.getElementById('buttonspan');%0A%09var x
  = d
@@ -256,59 +256,41 @@
 Id('
-buttonspan
+pr
 ');%0A
+%0A
 %09var 
-x = document.getElementById('pr'
+isValid = checkValid(
 );%0A%0A
@@ -327,114 +327,46 @@
 EXT%22
-)%0A%09%7B%0A%09%09newTable.style.display=%22inline%22;%0A%09%09oldTable.style.display=%22none%22;%0A%09%09buttonText.innerHTML =%22FINISH%22;
+ && isValidFirst)%0A%09%7B%0A%09%09changeTable(); 
 %0A%0A%09%09
@@ -416,16 +416,18 @@
 %25%22;%0A
+%09%0A
 %09%7D%0A%09else
 %0A%09%7B%0A
@@ -426,16 +426,12 @@
 else
-%0A%09%7B%0A%09%09
+ 
 if
+ 
 (but
@@ -463,15 +463,48 @@
 ISH%22
+ && isValidSecond
 )%0A
-%09
 %09%7B%0A%09
+%09alert(%22load%22);%09%0A
 %09%09pr
@@ -525,17 +525,16 @@
 %22100%25%22;%0A
-%09
 %09%09pr.inn
@@ -557,26 +557,306 @@
 %0A%0A%09%09
-%09alert(%22Load%22);%0A%09%09
+buttonText.innerHTML =%22FINISHED%22;%0A%09%7D%0A%09else%0A%09%7B%0A%09%09alert(%22Please select an option%22); %0A%09%7D%0A%7D%0A%0Afunction changeTable()%0A%7B%0A%09var newTable = document.getElementById('QuestionSet2');%0A%09var oldTable = document.getElementById('QuestionSet1');%0A%09%0A%09newTable.style.display=%22inline%22;%09%09%0A%09oldTable.style.display=%22none%22;%0A
 %09but
@@ -885,20 +885,28 @@
 NISH
-ED
 %22;%0A
-%09%09%7D%0A%09%7D%0A
+%7D%0A%0AcheckValid()%0A%7B
 %0A%7D%0A%0A

Validate Question.html radio buttons