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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Buggy JavaScript in Netscape 3.01

Status
Not open for further replies.

Kelmen

Programmer
Sep 20, 1998
10
US
I developed a client-sided JavaScript, which worked fine using Internet Explorer 4 and Netscape 4 browser, exception for Netscape 3.01.<br>
<br>
The script function is to check whether a textbox contained anything typed-in or not. In Netscape 3.01, after data been typed in the textbox, when the script executed, it show that the textbox is empty, but executed again is fined!<br>
<br>
Anyone got a clue or cure for this one?<br>
<br>
TIA.
 
Can't tell without seeing the code itself. Do you have a sample?
 
Here is it, it's been simplified:<br>
<br>
&lt;form method=post&gt;<br>
Company Logo :<br>
&lt;input type="file" name="LogoFileSpec" maxlength=50&gt;<br>
&lt;p&gt;<br>
&lt;input type="reset"&gt;<br>
&lt;input type="button" value="Submit" onClick="SubmitForm()"&gt;<br>
&lt;/form&gt;<br>
<br>
&lt;script language="JavaScript"&gt;<br>
function SubmitForm()<br>
{ <br>
if (document.forms[0].LogoFileSpec.value.length == 0)<br>
{ <br>
alert('Please attach your company logo.');<br>
document.forms[0].LogoFileSpec.focus();<br>
}<br>
else<br>
{<br>
document.forms[0].submit();<br>
}<br>
}<br>
&lt;/script&gt;
 
try using document.forms[0].elements[0].focus();<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top