Hi guys!
It's my first time on this forum and new to javascript too.
i've trying to do just a simple validation on a form but, i get cought up in a kind of endless loop that can't finish.
here is my code:
HTML Code:
<script language="javascript1.2" type="text/javascript">
function validate_firstname(field1){
   window.alert('please fill in the name');

function validate_surname(field2){
   window.alert('please fill in the surname');


<form id="form1" name="frmtest" method="post" action="">
  <input type="text" name="firstname" onblur="validate_firstname(this)"/>
    <input type="text" name="surname" onblur="validate_surname(this)" />
As u can see guys, all i want to do is, when some one press tab and didn't fill in a field, then a warning message must show up and, when u click ok it must take u back to the same textfield until u type something.
It's somehow working but, i get both functions being called in some king of an endless loop!

Please help out!