Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InputField Validation with NC6

Status
Not open for further replies.

RainerOesterlein

Programmer
Mar 12, 2001
2
DE
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=&quot;JavaScript1.2&quot;>
var onBlurnixtun=false;
var onBlurfalschesFeld=null;

function CheckEF1(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF1;
Eingabefeld.onfocus = MyonFocusEF1;
if (Eingabefeld.value == &quot;&quot;)
return;
MyonFocusEF1();
}

function CheckEF2(Eingabefeld)
{
Eingabefeld.onblur = MyonBlurEF2;
Eingabefeld.onfocus = MyonFocusEF2;
if (Eingabefeld.value == &quot;&quot;)
return;
MyonFocusEF2();
}

function MyonBlurEF1 (e)
{

document.frm.fld_eingabe12.value=&quot;blurEF1&quot;;
if (document.frm.fld_eingabe10.value==&quot;EF1&quot;)
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}

function MyonBlurEF2 (e)
{
document.frm.fld_eingabe12.value=&quot;blurEF2&quot;;
if (document.frm.fld_eingabe11.value==&quot;EF2&quot;)
{
onBlurnixtun = false;
return false;
}
else
{
onBlurnixtun = true;
onBlurfalschesFeld=null;
return true;
}
}

function MyonFocusEF1 (e)
{
document.frm.fld_eingabe12.value=&quot;focusEF1&quot;;

if (onBlurnixtun==false)
{
document.frm.fld_eingabe11.focus();
}
onBlurnixtun=true;
return true;

}

function MyonFocusEF2 (e)
{
document.frm.fld_eingabe12.value=&quot;focusEF2&quot;;
if (onBlurnixtun==false)
{
document.frm.fld_eingabe10.focus();
}
onBlurnixtun=true;
return true;
}


</SCRIPT>
</HEAD>
<BODY>
<FORM NAME=&quot;frm&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;fld_eingabe10&quot; maxlength=9 onFocus=&quot;CheckEF1(fld_eingabe10)&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;fld_eingabe11&quot; maxlength=9 onFocus=&quot;CheckEF2(fld_eingabe11)&quot;>
<BR>
<BR>
<INPUT TYPE=&quot;text&quot; NAME=&quot;fld_eingabe12&quot; maxlength=9 >
</FORM>
</BODY>
</HTML>

thank you
Rainer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top