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

How can I make My HTML Page Browser Compatible ?

Status
Not open for further replies.

mithra

Programmer
May 26, 2000
21
0
0
IN
Hi,<br>&nbsp;&nbsp;here I have a problem:<br>&nbsp;&nbsp;&nbsp;My HTML page works fine in IE and it is not working properly with NN4.6 .<br><br>&nbsp;&nbsp;What could be the reason ? How to overcome this proplem ?<br><br>It contains simple text boxes and Edit Boxes.<br>&nbsp;&nbsp;The Detail Code is given Here :<br><br>&lt;HTML&gt;<br><br>&lt;head&gt;<br>&lt;script language = &quot;JavaScript&quot;&gt;<br><br><br>function setfocus() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.first.SignInName.focus();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br>}<br><br>function Validate(){<br>var check = true;<br>var letters = document.first.SignInName.value;<br>&nbsp;&nbsp;&nbsp;&nbsp;if(chkLetters(letters)==false){<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.SignInName.select();<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.SignInName.focus();<br>&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Please fill the SignInName field&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>var letters = document.first.Password.value;<br>&nbsp;&nbsp;&nbsp;if(letters == &quot;&quot;){<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.Password.select();<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.Password.focus();<br>&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Please fill the Password field&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>var letters = document.first.FirstName.value;<br>&nbsp;&nbsp;&nbsp;&nbsp;if(chkLetters(letters)==false){<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.FirstName.select();<br>&nbsp;&nbsp;&nbsp;&nbsp;document.first.FirstName.focus();<br>&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Please fill&nbsp;&nbsp;the FirstName field&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>return check;<br>}<br><br>function chkLetters(field){<br>if(field!=&quot;&quot;){<br>&nbsp;&nbsp;&nbsp;&nbsp;for (var i = 0; i &lt; field.length; i++){<br>&nbsp;&nbsp;&nbsp;&nbsp;var chr = field.substring(i, i + 1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (((chr &lt; &quot;a&quot; ¦¦ &quot;z&quot; &lt; chr) && (chr &lt; &quot;A&quot; ¦¦ &quot;Z&quot; &lt; chr)) && chr != ' ') {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;alert(&quot;Please enter only alphabetic (a-z) characters and spaces in this field&quot;);<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}else{<br>return false;<br>}<br>return true;<br>}<br><br><br><br><br>&lt;/script&gt;<br>&lt;meta name=&quot;Microsoft Theme&quot; content=&quot;copy-of-rice-paper 111&quot;&gt;<br>&lt;/head&gt;<br><br>&lt;BODY onLoad = &quot;setfocus()&quot; background=&quot;ricebk.jpg&quot; bgcolor=&quot;#CCCC99&quot; text=&quot;#000000&quot; link=&quot;#6666CC&quot; vlink=&quot;#336633&quot; alink=&quot;#000099&quot; &gt;<br><br>&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot;&gt;<br><br>&lt;blockquote&gt;<br>&lt;blockquote&gt;<br>&lt;blockquote&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;blockquote&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--mstheme--&gt;&lt;/font&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&lt;H2&gt;&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot; color=&quot;#003300&quot;&gt;&lt;b&gt;&lt;font color=&quot;#800000&quot;&gt;<br>                   <br>                         &lt;/font&gt;&lt;/b&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--mstheme--&gt;&lt;/font&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/H2&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/blockquote&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/blockquote&gt;<br><br>&lt;!--mstheme--&gt;&lt;/font&gt;<br><br><br>&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot;&gt;<br><br>&lt;p&gt; &lt;!--mstheme--&gt;&lt;/font&gt;&lt;H3&gt;&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot; color=&quot;#003300&quot;&gt;&lt;b&gt;Profile Information - I&lt;/b&gt;&lt;!--mstheme--&gt;&lt;/font&gt;&lt;/H3&gt;<br><br>&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot;&gt;<br><br>&nbsp;&nbsp;&lt;/blockquote&gt;<br>&lt;/blockquote&gt;<br><br>&nbsp;&nbsp;&nbsp;<br>&lt;FORM&nbsp;&nbsp;NAME = &quot;first&quot; ACTION=&quot;Signup_SP2.htm&quot;&nbsp;&nbsp;&gt;<br>&lt;BLOCKQUOTE&gt;<br>&lt;blockquote&gt;<br>&nbsp;&nbsp;&lt;blockquote&gt;<br>&lt;P&gt;&lt;b&gt;&lt;font color=&quot;#800000&quot;&gt;Sign-In Name: &lt;/font&gt;&lt;/b&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt; <br>&lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;SignInName&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;                          <br>Password:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;          <br>&lt;INPUT TYPE=&quot;PASSWORD&quot; NAME=&quot;Password&quot; SIZE=&quot;18&quot;&gt;&lt;/FONT&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt;  &lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#800000&quot;&gt;First Name: &lt;/font&gt;&lt;/b&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt;     <br>&lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;FirstName&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;                     <br>Middle<br>Name:&lt;/FONT&gt;&lt;/B&gt;&lt;font color=&quot;#800000&quot;&gt;    &lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;MiddleName&quot; SIZE=&quot;18&quot;&gt;&lt;/font&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt; &lt;b&gt;Last Name: &lt;/b&gt;&lt;/font&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt;      <br>&lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;LastName&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;                     <br>Adress:&lt;/FONT&gt;&lt;/B&gt;&lt;font color=&quot;#800000&quot;&gt;              &lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Adress&quot; SIZE=&quot;18&quot;&gt;&lt;/font&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt; &lt;b&gt;City: &lt;/b&gt;&lt;/font&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt;                  <br>&lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;City&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;   <br>                <br>State:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;                 <br>&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;State&quot; SIZE=&quot;18&quot;&gt;&lt;/FONT&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt; &lt;b&gt;Zip Code: &lt;/b&gt;&lt;/font&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt;            &lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;ZipCode&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;   <br>                <br>Country:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;              <br>&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Country&quot; SIZE=&quot;18&quot;&gt;&lt;/FONT&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt;  &lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#800000&quot;&gt; Email-id: &lt;/font&gt;&lt;/b&gt;&lt;FONT COLOR=&quot;gray&quot;&gt;&lt;b&gt;           <br>&lt;/b&gt;&lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Email-id&quot; SIZE=&quot;20&quot;&gt;&lt;/FONT&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;Phone:&lt;/FONT&gt;&lt;/B&gt;&lt;FONT COLOR=&quot;#800000&quot;&gt;               &lt;INPUT TYPE=&quot;TEXT&quot; NAME=&quot;Phone&quot; SIZE=&quot;18&quot;&gt;&lt;/FONT&gt;&lt;/P&gt;<br>&lt;P&gt;&lt;font color=&quot;#800000&quot;&gt; &lt;/font&gt;&lt;/P&gt;<br>&lt;blockquote&gt;<br>&nbsp;&nbsp;&lt;blockquote&gt;<br>&lt;P&gt;                                                               <br>&lt;INPUT TYPE=&quot;SUBMIT&quot; NAME=&quot;Signup&quot; Value =&quot;Signup&quot;&nbsp;&nbsp;&gt;<br>&nbsp;&nbsp;&lt;/blockquote&gt;<br>&lt;/blockquote&gt;<br>&nbsp;&nbsp;&lt;/blockquote&gt;<br>&lt;/blockquote&gt;<br>&lt;/blockquote&gt;<br><br>&lt;!--mstheme--&gt;&lt;/font&gt;<br><br>&lt;H5&gt;&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot; color=&quot;#003300&quot;&gt;&lt;b&gt;&lt;font face=&quot;MS Serif&quot; color=&quot;#800000&quot;&gt;                                                                     <br>&lt;/font&gt; &lt;/b&gt; <br>&nbsp;<br>&lt;!--mstheme--&gt;&lt;/font&gt; <br>&nbsp;<br>&lt;/H5&gt;<br><br>&lt;!--mstheme--&gt;&lt;font face=&quot;Times New Roman, Times&quot;&gt;<br><br>&lt;/FORM&gt;<br><br>&lt;!--mstheme--&gt;&lt;/font&gt;<br><br>&lt;/BODY&gt;<br>&lt;/HTML&gt;<br><br><br><br><br>&nbsp;&nbsp;&nbsp;Thanks In Advance <br><br><br>Mithra<br>
 
There are two things I found.&nbsp;&nbsp;First, you originally wrote in the below statement: ...&quot;z&quot; &lt; chr ....&nbsp;&nbsp;Note the change I made to ...chr &gt; &quot;z&quot;....&nbsp;&nbsp;You can't compare a value to a variable, you must compare a variable to a value.&nbsp;&nbsp;Unless this is a quirk I don't know abut in JS.&nbsp;&nbsp;Also, your 'or' operator seemed to be incorrect even though it looks fine.&nbsp;&nbsp;I don't know what the deal is there, but I wouldn't have found it had I not run it through my scripting program and checked for syntax.&nbsp;&nbsp;Try retyping your 'or' operators as I have below.&nbsp;&nbsp;Once I made those changes, it appeared to work in both browsers.&nbsp;&nbsp;Also, my syntax checker says you're good down to Netscape 2.0 and IE 3.0 with respect to the SCRIPT.<br><br><br>if (((chr &lt; &quot;a&quot; ¦¦ chr &gt; &quot;z&quot;) && (chr &lt; &quot;A&quot; ¦¦ chr &gt; &quot;Z&quot; )) && chr != ' ') {<br>
 
Russ. what tool do you use for syntax checking? <p>nick bulka<br><a href=mailto: > </a><br><a href= > </a><br>
 
I'm usng a trial version of NetObjects ScripBuilder.&nbsp;&nbsp;You can find i at <A HREF=" TARGET="_new"> a little expensive, $134, and I normally wouldn't shell out that kind of money for just a script editor.&nbsp;&nbsp;But I really like his one.&nbsp;&nbsp;I'm not sure it's worth $134 but I think I'm going to bite the bullet.<br><br>I especially like the syntax checking and the browser compatibility checks.<br><br>Russ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top