document.all is *STRICTLY* an MSIE "feature" (or, rather, lack thereof).
The only browsers that *NEED* to use document.alll are MSIE 4 and earlier. Unless you really need to support 1999-vintage browsers, stop using document.all.
Instead, use ONLY document.getElementById(...)
But you don't need to use EITHER one of those here! You passed along the form, so why not USE it??
Well...you would have, but you goofed a little.
So:
Code:
<form name="form" onSubmit="SendData(this);return false;">
<script language="javascript" type="text/javascript">
function SendData (form)
{
var oldNm = form.txt1.value;
var NewNm = form.txt2.value;
location.href = "default.asp?on=" + escape(oldNm) + "&nn=" + escape(NewNm)
}
</script>
Now explain to me how this is any different than simply letting the <FORM> be submitted????????