Solved

Using <Div style=...> to show/hide checkbox, How to Remove <p> type effect of <div> in Table

Posted on 2007-12-06
2
1,242 Views
Last Modified: 2013-11-19
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.

--------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

Open in new window

0
Comment
Question by:Craig Lambie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
biztopia earned 125 total points
ID: 20418616
<div> is a block level tag, try using <span> instead.

Cheers
D
0
 
LVL 1

Author Closing Comment

by:Craig Lambie
ID: 31413105
Thanks D!!
I had tried span yesterday, but I think I was having issues with the style hidden at that stage!!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question