String.prototype.toProperCase = function () {
return this.replace(/\w\S*/
};
function check_kosong(){
els=['input_id_1','input_id_2'
for (var i_tem = 0; i_tem < els.length; i_tem++){
var check=document.getElementById(
if (check == ''){
var a=els[i_tem];
//replace underscore with space
var b=a.replace(/_/g, ' ');
//show alert with convert text to Proper Case/ Title Case
alert (b.toProperCase() +' belum di isi');
return false;
i_tem=els.length;
}
}
}
</script>
<form onSubmit="return check_kosong();" action="../
......
......
.......
</form>
No comments:
Post a Comment