<script>
function checkName(){
var tmpName = document.getElementById("name");
if( tmpName.value.length == 0 ){
alert( "Name cannot be empty" );
return false;
}
else
return true;
}
function confirmForm( formObj ){
var nameBool = new Boolean();
var errorName = "";
nameBool = checkName();
if( nameBool == false )
errorName = "Invalid data in input name !";
return window.alert( "You have this error : \n " + errorName + "\n" + errorID );
}
</script>
<form name=reviewform onsubmit="return confirmForm(reviewForm)" method=POST >
<p>Name : <input type="text" id="name" ></p>
<p>ID : <input type="text" id="id" ></p>
<input type="submit" value="Click here!">
</form>
my problem is why my function cannot run ??? isn't something wrong? can any senior teach me where the place i wrong at??
i already editited and plus that form name and the function how it's work
i don't know isn't my implementation wrong or what