RainerOesterlein
Programmer
Hello
I need to implement a simple validation between 2 Input Field on a form. If a user enters a wrong text in InputField1 and then he clicks on InputField2, the focus may stay in InputField1.
My Problem is, that everything works fine in IE5 but in NC6 the code does not work correct.
After entering "EF1" in InputFIeld1 and clicking on Input Field 2 in NC 6 the focus is visible in InputField1 but by entering some text the characters are shown in InputField2.
I am really confused about that. Can anybody help me!
<HTML><HEAD>
<TITLE>TEST</TITLE>
<SCRIPT language="JavaScript1.2">
var onBlurnixtun=false;
var onBlurfalschesFeld=null;
function CheckEF1(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF1;
Eingabefeld.onfocus = MyonFocusEF1;
if (Eingabefeld.value == ""
return;
MyonFocusEF1();
}
function CheckEF2(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF2;
Eingabefeld.onfocus = MyonFocusEF2;
if (Eingabefeld.value == ""
return;
MyonFocusEF2();
}
function MyonBlurEF1 (e)
{
document.frm.fld_eingabe12.value="blurEF1";
if (document.frm.fld_eingabe10.value=="EF1"
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}
function MyonBlurEF2 (e)
{
document.frm.fld_eingabe12.value="blurEF2";
if (document.frm.fld_eingabe11.value=="EF2"
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}
function MyonFocusEF1 (e)
{
document.frm.fld_eingabe12.value="focusEF1";
if (onBlurnixtun==false)
{
document.frm.fld_eingabe11.focus();
}
onBlurnixtun=true;
return true;
}
function MyonFocusEF2 (e)
{
document.frm.fld_eingabe12.value="focusEF2";
if (onBlurnixtun==false)
{
document.frm.fld_eingabe10.focus();
}
onBlurnixtun=true;
return true;
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
<INPUT TYPE="text" NAME="fld_eingabe10" maxlength=9 onFocus="CheckEF1(fld_eingabe10)">
<INPUT TYPE="text" NAME="fld_eingabe11" maxlength=9 onFocus="CheckEF2(fld_eingabe11)">
<BR>
<BR>
<INPUT TYPE="text" NAME="fld_eingabe12" maxlength=9 >
</FORM>
</BODY>
</HTML>
thank you
Rainer
I need to implement a simple validation between 2 Input Field on a form. If a user enters a wrong text in InputField1 and then he clicks on InputField2, the focus may stay in InputField1.
My Problem is, that everything works fine in IE5 but in NC6 the code does not work correct.
After entering "EF1" in InputFIeld1 and clicking on Input Field 2 in NC 6 the focus is visible in InputField1 but by entering some text the characters are shown in InputField2.
I am really confused about that. Can anybody help me!
<HTML><HEAD>
<TITLE>TEST</TITLE>
<SCRIPT language="JavaScript1.2">
var onBlurnixtun=false;
var onBlurfalschesFeld=null;
function CheckEF1(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF1;
Eingabefeld.onfocus = MyonFocusEF1;
if (Eingabefeld.value == ""
return;
MyonFocusEF1();
}
function CheckEF2(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF2;
Eingabefeld.onfocus = MyonFocusEF2;
if (Eingabefeld.value == ""
return;
MyonFocusEF2();
}
function MyonBlurEF1 (e)
{
document.frm.fld_eingabe12.value="blurEF1";
if (document.frm.fld_eingabe10.value=="EF1"
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}
function MyonBlurEF2 (e)
{
document.frm.fld_eingabe12.value="blurEF2";
if (document.frm.fld_eingabe11.value=="EF2"
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}
function MyonFocusEF1 (e)
{
document.frm.fld_eingabe12.value="focusEF1";
if (onBlurnixtun==false)
{
document.frm.fld_eingabe11.focus();
}
onBlurnixtun=true;
return true;
}
function MyonFocusEF2 (e)
{
document.frm.fld_eingabe12.value="focusEF2";
if (onBlurnixtun==false)
{
document.frm.fld_eingabe10.focus();
}
onBlurnixtun=true;
return true;
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="frm">
<INPUT TYPE="text" NAME="fld_eingabe10" maxlength=9 onFocus="CheckEF1(fld_eingabe10)">
<INPUT TYPE="text" NAME="fld_eingabe11" maxlength=9 onFocus="CheckEF2(fld_eingabe11)">
<BR>
<BR>
<INPUT TYPE="text" NAME="fld_eingabe12" maxlength=9 >
</FORM>
</BODY>
</HTML>
thank you
Rainer