Location: PHPKode > projects > GolfstatsPHP > golfstatsphp_3.0/coursefunctions.inc.php
<script>
function checkrequired(which){
var pass=true
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]

if (tempobj.name.substring(0,3)=="req"){
if (((tempobj.type=="text"||tempobj.type=="textarea")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==-1)){
pass=false
break
}
}
}
}
if (!pass){
alert("Please fill Course Name,course ID, slope and course ratings.")
return false
}
else
return true
}



</script>


<?



function listpars($max, $choosedigit)
{
	if (!$max) { exit; } # Prevent endless loops

	for($i = 3; $i <= $max; $i++) 
	{
		if ($i < 10) { $val = $i; }
		else { $val = $i; }

		if($i == $choosedigit) { $sel = "selected"; }
		else { $sel = ""; } 

		$makereturn .= "<option $sel value='$val'>$val</option>\n";
    }

	return $makereturn;
}

function listindex($max, $choosedigit)
{
	if (!$max) { exit; } # Prevent endless loops

	for($i = 1; $i <= $max; $i++) 
	{
		if ($i < 10) { $val =  $i; }
		else { $val = $i; }

		if($i == $choosedigit) { $sel = "selected"; }
		else { $sel = ""; } 

		$makereturn .= "<option $sel value='$val'>$val</option>\n";
    }

	return $makereturn;
}

?>
Return current item: GolfstatsPHP