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

Disappearing Text in NS

Status
Not open for further replies.

YogeshPancholi

Programmer
Jul 4, 2000
14
0
0
CA
I have a form page where the input fields and associated label text are in separate columns of a table.

eg. <td>Please enter your name</td>
<td><input type=&quot;text&quot; name=&quot;txtName&quot;></td> ...etc

When the user clicks submit, my client-side validation JavaScript goes through each input field, and if it finds any errors, it turns the label text red and displays a message at the bottom of the form. This works fine in IE, but I'm having problems in NS. For each label text I have introduced a DIV (to layer it) and a SPAN (for changing the text colour).

eg.
<td>
<div id=&quot;idNameDiv&quot; style=&quot;position:relative&quot;>
<span class=&quot;blackFont&quot;>Please enter your name</span>
</div>
</td>
<td><input type=&quot;text&quot; name=&quot;txtName&quot;></td> ...etc

If a user error is encountered, my JavaScript rewrites the idNameDiv layer with the span class=&quot;redFont&quot;. The problem is when the layer is re-written, it does not get displayed (ie. it looks like that the label text has disappeared). But if I resize my browser window, the label text appears (in red as expected).

Does anyone know why NS is behaving in this way?? Also, can anyone suggest how I can get the text to appear without manually resizing my browser window?

As a workaround I added the following code on a user input error condition:
window.resizeBy(1,1;
window.resizeBy(-1, -1);

However, this doesn't work if the browser window is maximized.

Any help will be greatly appreciated.




Yogesh Pancholi

&quot;If a pig loses its voice, is it disgruntled?&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top