can anybody help me ,
how can we call a javascript function using firefox browser. my code is working fine when im using IE but not for firefox. Why i cant understood.When im clicking button no action was taken and nothing was happned.

<script type="text/javascript">
 function login_validate(frm)
 {var name=frm.user_name.value;
 if(name=="")
  {alert("Please Enter UserName");
  frm.user_name.focus();
  return false;
  }
   if(frm.password.value=="")
  {alert("Please Enter Password");
  frm.password.focus();
  return false;
  }
  frm.user.value=name;
  document.frm.action="./loginServlet?from=login";
    
 }
 function unload_win()
 {
	 frm.action="http://www.ceoandhra.nic.in";
	 }
 
 </script>

<input type="submit" name="but" id="but" value="Login" tabindex="3" onclick="return login_validate(document.frm)" />

In ff, Use the getElementById to call elements in your form, e.g. document.getElementById('yourform').formelement.value = 'yourValue';

thank u,
it is working fine

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.