473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

onClick Toggle - Help Please!

Hi... I have a problem and I hope someone can help me out!

I have two series of radio buttons...(call them Group A and Group B)
and a Textarea.

When you click on any of the radio buttons in the A group, it
automatically adds some text to the textarea, using a javascript
onClick function.

When you click on any of the radio buttons in the B group, it appends
another line of text to the existing text already in the textarea,
again, using a javascript onClick function

What I need is to make the group B onClick act like a toggle, so if
the associated text isn't there, it will add it... but if it IS
there... it will remove it.

If that's not clear enough... here's an example

------------------------
Group A
Radio1 Radio2 Radio3 Radio4 Radio5

Group B
Radio1 Radio2 Radio3 Radio4 Radio5

TextArea
-------------------------

If Group A/Radio1 is clicked it adds the text
"Here is some text." to the textarea

Then, if Group B/Radio1 is clicked it appends the text
" And here is some more." to the existing text.... So the final text
is: "Here is some text. And here is some more."

If I then click GroupB/Radio1 again.... I'd like it to remove the
GroupB/radio1 text, leaving the GroupA text alone and giving me just:
"Here is some text"

So.....

Click GroupA/Radio1
"Here is some text"

Click GroupB/Radio1 once:
"Here is some text. And here is some more"

Click GroupB/Radio1 again:
"Here is some text"

Does that make sense? Can someone help me please?

Thanks!. Sarah :)


Jul 20 '05 #1
1 3328
Nevermind... I figured it out.... :p
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Edward | last post by:
The code shown below displays a table in a form with 3 check boxes. When the left checkbox is selected, all other checkboxes are also selected (hotmail style) (thanks for the groups help with...
1
by: tshad | last post by:
Is there a way to change the onClick event of a LinkButton? At the moment, I am using 2 buttons that I toggle the visibility on and off. I would like to use just one button, if possible and just...
1
by: Tim::.. | last post by:
Is there a way to fire an onClick JavaScript event on the next page to be loaded in ASP.NET??? I have 2 asp.net pages... page 1. With just a standard link to the next page. page 2. Has a...
7
by: Giacomo | last post by:
I work on a page structured like: <h2> ... </h2> <div ="div1" class="show"> ... </div> <h2> ... </h2> <div id="div2" class="show"> ... </div> <h2> ... </h2> <div id="div3" class="show">...
11
by: Daz | last post by:
Hello everyone. I am sure the answer to my question is simple, but I can't seem to dynamically add an onClick event to my script. I have a table which is generated dynamically, I am just...
2
by: webdeveloper | last post by:
sorry about that, This is the event handling element: <div id="menu"> <ul> <li>.... <li><a href="javascript:expand_menu(document.getElementById('extend'))" id="extend">Text <img src=""...
3
by: macsaregreat | last post by:
How do you apply 2 onclick events to a check box. I googled this and found multiple ways of doing it, but they dont work. Maybe i was not using the correct syntax, but i cant figure it out. these...
2
by: printline | last post by:
I have problem with onclick in Flash, Please help.... I have a javascript function that says the following: <script type="text/javascript"> function startLoading() { ...
1
by: Amit1980 | last post by:
I have to toggle the arrow image on onclick event. Here is the code with the required functionility. What I want now is, when the page loads there will be right arrow images. The arrow should be...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
1
isladogs
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...
0
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.