HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 1st, 2003, 03:48 AM
kgb-fbi kgb-fbi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Jhb
Posts: 54 kgb-fbi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 sec
Reputation Power: 6
Div tag visibility

I have a form where a user must select a number.
If the number is smaller than 10, another textfield that was hidden must appear.

The above mention is easy. But I want the whole row to be 'hidden'. The heading and the <input> box.

The problem with this is that the moment I put the div tags over the <tr> tags the div tag appears to visible.

Here is the code I use:

****This works****

<script>
function choose_roh()
{
if((window.reg_form.roh.value <= 9) && (window.reg_form.roh.value != 0))
{window.direct_no.style.visibility = "visible";}
else
{window.direct_no.style.visibility = "hidden";}

<body>
...
<tr>
<td>Direct nr:</td>
<td>
<div style="visibility: hidden;" id="direct_no" name="direct_no">
<input name="direct_code" type="text" id="fax_area" style="width: 44px" value="" maxlength="3" />
-
<input name="direct_num" type="text" id="fax_num" style="width: 70px" value="" maxlength="8" />

</div>
</td>
</tr>

*****But I want to do this******Put the whole row in div tags

<div style="visibility: hidden;" id="direct_no" name="direct_no">
<tr>
<td>* Direct:</td>
<td>
<input name="direct_code" type="text" id="fax_area" style="width: 44px" value="" maxlength="3" />
-
<input name="direct_num" type="text" id="fax_num" style="width: 70px" value="" maxlength="8" />
</td>
</tr>
</div>

Reply With Quote
  #2  
Old August 1st, 2003, 04:00 AM
kgb-fbi kgb-fbi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Jhb
Posts: 54 kgb-fbi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 sec
Reputation Power: 6
my solution

My other option is to use two div tags and one function.

************
<script>
function choose_roh()
{
if((window.reg_form.roh.value <= 9) && (window.reg_form.roh.value != 0))
{window.direct_no.style.visibility = "visible";
window.direct_no1.style.visibility = "visible";}
else
{window.direct_no.style.visibility = "hidden";
window.direct_no1.style.visibility = "hidden";}
</script>
....

<body>
....

<tr>
<td>
<div style="visibility: hidden;" id="direct_no" name="direct_no">
* Direct:
</div>
</td>
<td>
<div style="visibility: hidden;" id="direct_no1" name="direct_no1">
<input name="direct_code" type="text" id="fax_area" style="width: 44px" value="" maxlength="3" />
-
<input name="direct_num" type="text" id="fax_num" style="width: 70px" value="" maxlength="8" />
</div>
</td>
</tr>

Reply With Quote
  #3  
Old August 1st, 2003, 04:02 AM
DanEaston DanEaston is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Cambridge, UK
Posts: 31 DanEaston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
move style="visibility: hidden;" id="direct_no" name="direct_no" into the <tr> tag and it should work

Reply With Quote
  #4  
Old August 1st, 2003, 04:14 AM
kgb-fbi kgb-fbi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Jhb
Posts: 54 kgb-fbi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 sec
Reputation Power: 6
Tnx

I didnt even think about that.....silly me...

Thanx....You're da BOMB!!!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Div tag visibility


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT