Hi All,
Im not very well versed in javascript at all so hoping someone can help me
out here.
I have a page that uses pairs of radio buttons to toggle visibility of some
table columns.
I need to convert the radio button pairs to a single checkbox so Im thinking
just a function to check the status of the checkbox and "SHOW" if checked,
and "HIDE" if not checked.
Here are my radio buttons:
<!-- Show/Hide Column 1 -->
<input type="radio" name="Col1Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 0);">
<input type="radio" name="Col1Visibility"
onclick="ChangeColumnVisibility('collapse', 0);">
<!-- Show/Hide Column 2 -->
<input type="radio" name="Col2Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 1);">
<input type="radio" name="Col2Visibility"
onclick="ChangeColumnVisibility('collapse', 1);">
<!-- Show/Hide Column 3 -->
<input type="radio" name="Col3Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 2);">
<input type="radio" name="Col3Visibility"
onclick="ChangeColumnVisibility('collapse', 2);">
And so on...
I need to figure out a "Toggle" function for my checkbox
<!-- Show/Hide Column 1 -->
<input id="Col1Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility???', 0);" />
<!-- Show/Hide Column 2 -->
<input id="Col2Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 1);" />
<!-- Show/Hide Column 3 -->
<input id="Col3Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 2);" />
<!-- Show/Hide Column 4 -->
<input id="Col4Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 3);" />
Should be something like:
Function Toggle...
if checkbox is checked, then ChangeColumnVisibility('visible', 0);
else
ChangeColumnVisibility('collapse', 0);
But Im not sure of the syntax nor how to get the column number.
Can you help me out with this?
Thanks a TON in advance! 1 3433
Hey - Got if figured out!
Maybe review to see if it could be done better?
function ToggleColumn(obj_checkbox, n)
{
if(obj_checkbox.checked)
{
ChangeColumnVisibility('visible', n);
}
else
{
ChangeColumnVisibility('collapse', n);
}
}
<input id="Column1" type="checkbox" checked="CHECKED"
onclick="ToggleColumn(this, 0);" />
Thanks
"Mike Bahr" <ta****@alltel.netwrote in message
news:9a**************************@ALLTEL.NET...
Hi All,
Im not very well versed in javascript at all so hoping someone can help me
out here.
I have a page that uses pairs of radio buttons to toggle visibility of
some table columns.
I need to convert the radio button pairs to a single checkbox so Im
thinking just a function to check the status of the checkbox and "SHOW" if
checked, and "HIDE" if not checked.
Here are my radio buttons:
<!-- Show/Hide Column 1 -->
<input type="radio" name="Col1Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 0);">
<input type="radio" name="Col1Visibility"
onclick="ChangeColumnVisibility('collapse', 0);">
<!-- Show/Hide Column 2 -->
<input type="radio" name="Col2Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 1);">
<input type="radio" name="Col2Visibility"
onclick="ChangeColumnVisibility('collapse', 1);">
<!-- Show/Hide Column 3 -->
<input type="radio" name="Col3Visibility" checked="checked"
onclick="ChangeColumnVisibility('visible', 2);">
<input type="radio" name="Col3Visibility"
onclick="ChangeColumnVisibility('collapse', 2);">
And so on...
I need to figure out a "Toggle" function for my checkbox
<!-- Show/Hide Column 1 -->
<input id="Col1Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility???', 0);" />
<!-- Show/Hide Column 2 -->
<input id="Col2Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 1);" />
<!-- Show/Hide Column 3 -->
<input id="Col3Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 2);" />
<!-- Show/Hide Column 4 -->
<input id="Col4Visibility" type="checkbox" checked="CHECKED"
onclick="Toggle('ChangeColumnVisibility', 3);" />
Should be something like:
Function Toggle...
if checkbox is checked, then ChangeColumnVisibility('visible', 0);
else
ChangeColumnVisibility('collapse', 0);
But Im not sure of the syntax nor how to get the column number.
Can you help me out with this?
Thanks a TON in advance! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: ComputerSmith |
last post by:
Hi all.
I have programmed VB6 apps before, ones that use dropdown listboxes, text
boxes, etc... normal stuff.
I was asked by a friend to write a "simple" app that I am unsure how to
proceed...
|
by: max reason |
last post by:
A method in one of my classes needs to call one of 256 other methods
in the same class based on an unsigned 8-bit value (0x00 to 0xFF).
How is this done? Everything I try generates errors. ...
|
by: Christo |
last post by:
borland c++ 5.01
character constant must be one or two characters long
get this when compiling my first c++ program can anyone out there help?
it is highlighting this line as the problem
...
|
by: francisco lopez |
last post by:
ok , first of all sorry if my english is not so good, I do my best.
here is my problem:
I don´t know much javascript so I wrote a very simple one to validate
a form I have on my webpage.
...
|
by: Proteus |
last post by:
Any help appreciated on a small perl project I need to write for
educator/teaching purposes. I have not programmed perl for some time, need
to get up to speed, maybe some kind souls hrere will help...
|
by: Bonj |
last post by:
I'm mainly experienced in VB6, haven't really got to grips
with .NET very much. I'd like to create, more as a
practice project than anything, a simple ASP.NET web
application that will just do...
|
by: jerry.ranch |
last post by:
Say, on a data entry form
a "HELP" cmbBUTTON that bounces the user off to word file that has
help, or is there some other way to do it (like a label object with
help on another form)
Thanks...
|
by: Ken Crismon |
last post by:
Hello,
I am currently working on an embedded systems project where by I have
written a small web server that is being hosted on our internet appliance
(running on an Atmega128 chip and doing...
|
by: Vicissitude24 |
last post by:
Our instructor had given us a task to create a four-in-a-row game in C+
+(DEV).
I was able to create a 2player human-human game.
but unfortunately our instructor added new details.
to add an AI...
|
by: 73k5blazer |
last post by:
Hello again all..
We have a giant application from a giant software vendor that has very
poor SQL.
It's a PLM CAD application, that makes a call to the db for every cad
node in the assembly.
So...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: Aftab Ahmad |
last post by:
Hello Experts!
I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
| |