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!

Problem with InputField validation in Netscape

Status
Not open for further replies.

RainerOesterlein

Programmer
Mar 12, 2001
2
DE
Hello
During the Implementation of my JavaScript i run into i difficult error.
On my HTML site there are two InputFields. The Site is included in a framset.
By Leaving the first Inputfield i wish to activate an Alert Message and the focus may not leave the first input field.

The Implementation works fine with IE5.5 but in Netscape 4.7.x i run in an endlessloop when the
Alert Messages will be shown.



Here my Example

<HTML><HEAD>
<TITLE></TITLE></HEAD>
<FRAMESET rows=&quot;130,*&quot; border=&quot;0&quot; frameborder=&quot;0&quot; framespacing=&quot;0&quot;>
<FRAME src=&quot;Leer.htm&quot; name=&quot;BelegVwUnten&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;>
<FRAME src=&quot;test.html&quot; name=&quot;BelegVwEingabe&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot;>
</FRAMESET><BODY><NOFRAMES><BODY>


Test.html
<HTML><HEAD>
<TITLE>TEST</TITLE>
<SCRIPT language=&quot;JavaScript&quot;>
function Check(Eingabefeld)
{
if (Eingabefeld.value == &quot;&quot;)
return;
var wert = Eingabefeld.value;
alert(&quot;Ungültiger Wert&quot;);
Eingabefeld.focus();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME=&quot;frm&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;fld_eingabe10&quot; maxlength=4 onBlur=&quot;Check(fld_eingabe10)&quot;>
<INPUT TYPE=&quot;text&quot; NAME=&quot;fld_eingabe11&quot; maxlength=4 >
</FORM></BODY></HTML>

Leer.html
<HTML>
<HEAD>
<TITLE>Neuanlage Mandant</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>


Does anyone has a solution for this Problem??
 
Hi RainerOesterlein!
I looked trough your code and didn't find anything bad. Sorry, have no time to test it.

Try to change onBlur=&quot;Check(fld_eingabe10)&quot;
to this:
onBlur=&quot;Check(this.value)&quot;

function Check(Eingabefeld)
{
  if (Eingabefeld == &quot;&quot;)
. . . .

Hope it will help.
 
On the same topic, I am facing a weird problem only in Netscape 4.7. I passing the value using (this.value) in a <Select> tag. but every time getting null value. Working fine in IE5.

My script is :

<html>
<head>
<script language=&quot;javascript&quot;>
function func1(myval){
alert(myval)
}
</script>
</head>

<body>
<form name=&quot;test&quot;>
<select name=&quot;select&quot; onChange=&quot;func1(this.value)&quot;>
<option value=1>1
<option value=2>2
</select>
</body>
</html>

Please help.

Ketan
 
Hello ketanksah
try this code
html>

<head>

<script language=&quot;JavaScript&quot;>
<!--
function dropdown()
{
var ausgewaehlt=document.test.Farben.options[document.test.Farben.options.selectedIndex].value;
alert(ausgewaehlt);


}
//-->
</script>
</head>

<body>

<p align=&quot;center&quot;><big><big><strong>Choose a Color</strong></big></big></p>

<form name=&quot;test&quot;>
<div align=&quot;center&quot;><center><p><select name=&quot;Farben&quot; size=&quot;1&quot; onChange=&quot;dropdown()&quot;>
<option value=&quot;hgf&quot;>BackColor</option>
<option value=&quot;blue&quot;>blau</option>
<option value=&quot;yellow&quot;>gelb</option>
<option value=&quot;lightgrey&quot;>grau</option>
<option value=&quot;green&quot;>grün</option>
<option value=&quot;red&quot;>rot</option>
<option value=&quot;white&quot;>weiß</option>
</select></p>
</center></div>
</form>
</body>
</html>


this works!

Rainer
 
Thanks Rainer. Your code works fine in both the browser.

Ketan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top