|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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> |
|
#3
|
|||
|
|||
|
move style="visibility: hidden;" id="direct_no" name="direct_no" into the <tr> tag and it should work
|
|
#4
|
|||
|
|||
|
Tnx
I didnt even think about that.....silly me...
Thanx....You're da BOMB!!! |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Div tag visibility |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|