Craig Lambie
asked on
Using <Div style=...> to show/hide checkbox, How to Remove <p> type effect of <div> in Table
Hi Experts,
After searching for the best way to show/hide a checkbox with some text next to it, I settled on using a <div> and vbscript to change the style visibility.
My issue now is that the <div> actually effects the insides of the <td> making it appear to be 2 lines, like it was a <p> or something.
Is there some way of removing this effect, so that is simply appears next to the text? Maybe another tag?
The HTML is dynamically created from ASP, based on a SP.
I look forward to your reply.
After searching for the best way to show/hide a checkbox with some text next to it, I settled on using a <div> and vbscript to change the style visibility.
My issue now is that the <div> actually effects the insides of the <td> making it appear to be 2 lines, like it was a <p> or something.
Is there some way of removing this effect, so that is simply appears next to the text? Maybe another tag?
The HTML is dynamically created from ASP, based on a SP.
I look forward to your reply.
--------Snippet - Source HTML-----------
<tr><td class=Bonds><a href=TransBankView_nh1.asp?BankCode=BA >BA </td><td class=Bonds> </td>
<td class=Bonds>DD</td>
<td class=Bonds>POOL </td>
<td class=Bonds>80,000,000</td>
<td class=Bonds>12,690</td>
<td class=Bonds>80,012,690</td>
<td class=Bonds align=center><INPUT Type=CheckBox Name=checkall3 onclick=vbscript:enablePI(3)>
<div name=divcheckbox3 STYLE="visibility: hidden">PI<INPUT type=CheckBox Name=PI3></div>
<INPUT Type=Hidden Name=TranID3 Value=1677></td></tr>
-------VBScript--------
Function enablePI(intID)
dim CA
dim PI
CA = "checkall" & intID
PI = "PI" & intID
if Frmcheckall.elements(CA).checked = true then
Eval("divcheckbox" & intID).style.visibility = "visible"
Frmcheckall.elements(PI).checked = 0
else
Eval("divcheckbox" & intID).style.visibility = "hidden"
Frmcheckall.elements(PI).checked = 0
end if
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I had tried span yesterday, but I think I was having issues with the style hidden at that stage!!