473,545 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

change text color onclick, and change it back - will post to DB

I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:

Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.

I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.

Anyone ever heard of something like this?

Mar 28 '07 #1
10 3564
"apparker" <ad**********@g mail.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:

Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.
You are in luck. Very recently someone threw together a nifty example.

http://groups.google.com/group/comp....9b47d50fc007b1
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.

Anyone ever heard of something like this?
Sure, submit all your checkboxes (and the form) to your server-side script. Of course, if
checked, submit 1, if not, 0.

-Lost
Mar 29 '07 #2
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.ne twrote:
"apparker" <adamparke...@g mail.comwrote in message

news:11******** **************@ b75g2000hsg.goo glegroups.com.. .
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:
Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.

You are in luck. Very recently someone threw together a nifty example.

http://groups.google.com/group/comp....wse_thread/thr...
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.
Anyone ever heard of something like this?

Sure, submit all your checkboxes (and the form) to your server-side script. Of course, if
checked, submit 1, if not, 0.

-Lost
Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios? Would it be possible to not
have the checkbox at all?

Mar 29 '07 #3
"apparker" <ad**********@g mail.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.ne twrote:
>"apparker" <adamparke...@g mail.comwrote in message

news:11******* *************** @b75g2000hsg.go oglegroups.com. ..
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:
Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.

You are in luck. Very recently someone threw together a nifty example.

http://groups.google.com/group/comp....wse_thread/thr...
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.
Anyone ever heard of something like this?

Sure, submit all your checkboxes (and the form) to your server-side script. Of course,
if
checked, submit 1, if not, 0.
>
Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios?
I do not see why not.
Would it be possible to not
have the checkbox at all?
Visually? Sure, hide them via CSS (display: none; will destroy layout; visibility:
hidden; will preserve it).

You do not want to get rid of the checkboxes or radio inputs altogether. You would have
to code a scheme by which to trap 1 and 0s, and eventually send it to the server.

Keeping the form intact insures the ability to submit form contents.

-Lost

Mar 29 '07 #4
On Mar 28, 9:19 pm, "-Lost" <missed-s...@comcast.ne twrote:
"apparker" <adamparke...@g mail.comwrote in message

news:11******** **************@ o5g2000hsb.goog legroups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.ne twrote:
"apparker" <adamparke...@g mail.comwrote in message
>news:11******* *************** @b75g2000hsg.go oglegroups.com. ..
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:
Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.
You are in luck. Very recently someone threw together a nifty example.
>http://groups.google.com/group/comp....wse_thread/thr...
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.
Anyone ever heard of something like this?
Sure, submit all your checkboxes (and the form) to your server-side script. Of course,
if
checked, submit 1, if not, 0.
Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios?

I do not see why not.
Would it be possible to not
have the checkbox at all?

Visually? Sure, hide them via CSS (display: none; will destroy layout; visibility:
hidden; will preserve it).

You do not want to get rid of the checkboxes or radio inputs altogether. You would have
to code a scheme by which to trap 1 and 0s, and eventually send it to the server.

Keeping the form intact insures the ability to submit form contents.

-Lost
perfect... love it, thanks so much!

Mar 29 '07 #5
On Mar 28, 9:37 pm, "apparker" <adamparke...@g mail.comwrote:
On Mar 28, 9:19 pm, "-Lost" <missed-s...@comcast.ne twrote:
"apparker" <adamparke...@g mail.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.ne twrote:
>"apparker" <adamparke...@g mail.comwrote in message
>>news:11****** *************** *@b75g2000hsg.g ooglegroups.com ...
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:
Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.
>You are in luck. Very recently someone threw together a nifty example.
>>http://groups.google.com/group/comp....wse_thread/thr...
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.
Anyone ever heard of something like this?
>Sure, submit all your checkboxes (and the form) to your server-side script. Of course,
>if
>checked, submit 1, if not, 0.
Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios?
I do not see why not.
Would it be possible to not
have the checkbox at all?
Visually? Sure, hide them via CSS (display: none; will destroy layout; visibility:
hidden; will preserve it).
You do not want to get rid of the checkboxes or radio inputs altogether. You would have
to code a scheme by which to trap 1 and 0s, and eventually send it to the server.
Keeping the form intact insures the ability to submit form contents.
-Lost

perfect... love it, thanks so much!
another question, could other css styles interfere with this trick? I
got it working on a simple page, but not a complicated one with lots
of js and css styles.

Mar 29 '07 #6
"apparker" <ad**********@g mail.comwrote in message
news:11******** ************@o5 g2000hsb.google groups.com...
>>
I'm creating a new GUI for a program and it is for a medical exam.
There are so many different things to ask someone during a history it
wastes too much space to make checkboxes for everything so I had an
idea:
Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.
>You are in luck. Very recently someone threw together a nifty example.
>>http://groups.google.com/group/comp....wse_thread/thr...
I'd also like the event to post "1" or "0" to DB so the conditions can
be saved into the DB.
Anyone ever heard of something like this?
>Sure, submit all your checkboxes (and the form) to your server-side script. Of
course,
if
checked, submit 1, if not, 0.
Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios?
I do not see why not.
Would it be possible to not
have the checkbox at all?
Visually? Sure, hide them via CSS (display: none; will destroy layout; visibility:
hidden; will preserve it).
You do not want to get rid of the checkboxes or radio inputs altogether. You would
have
to code a scheme by which to trap 1 and 0s, and eventually send it to the server.
Keeping the form intact insures the ability to submit form contents.
-Lost

perfect... love it, thanks so much!

another question, could other css styles interfere with this trick? I
got it working on a simple page, but not a complicated one with lots
of js and css styles.
In a word, yes.

-Lost
Mar 29 '07 #7
In comp.lang.javas cript message <11************ **********@b75g 2000hsg.go
oglegroups.com> , Wed, 28 Mar 2007 12:12:22, apparker
<ad**********@g mail.composted:
>Can I simply create a list of conditions and when the doctor clicks
them, they turn red? And clicking them again would make them default
again? This would really make the exam better since the doctor could
quickly glance at a page of hundreds of things and see what the person
has.
This illustrates the fundamentals of part of a possibility :-

<span onClick="alert( this.style.colo r=new Date()%0x100000 0)">hhh</a>

But test the human-interface aspects carefully before committing
yourself to the approach.

It could be useful to select with a checkbox, but re-colour the
associated text as a better indication.

Perhaps each condition should have four states -
Default unconsidered
Condition applies
Condition does not apply
Condition considered but undecided.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v6.05 IE 6
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 29 '07 #8
-Lost wrote:
"apparker" <ad**********@g mail.comwrote in message
news:11******** ************@o5 g2000hsb.google groups.com...
>>>>>>I'm creating a new GUI for a program and it is for a medical exam.
>>There are so many different things to ask someone during a history it
>>wastes too much space to make checkboxes for everything so I had an
>>idea:
>>Can I simply create a list of conditions and when the doctor clicks
>>them, they turn red? And clicking them again would make them default
>>again? This would really make the exam better since the doctor could
>>quickly glance at a page of hundreds of things and see what the person
>>has.
>You are in luck. Very recently someone threw together a nifty example.
>http://groups.google.com/group/comp....wse_thread/thr...
Hi,

I asked the question leading to the response referenced above. Pasted
below is my modified script that processes radio buttons as well as
check boxes.

I ended up wrapping the input tag within the label tag and using
parentNode instead of nextSibling. nextSibling worked fine in the
example referenced above but can easily break if the input and label
tags are formatted on different lines (whitespace becomes a text node
and becomes the nextSibling).

As stated in the referenced thread, my form is pretty dense and may have
a hundred check boxes or radio buttons. The buff-ish background and
crimson colors seem to work well for me. I think the indentation below
is messed up from my translation from tabs to spaces -- sorry.

Roger
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title>
highlight checkbox labels
</title>

<style type="text/css">
body {background: #FFEBCD; color: #382400; font-family:
verdana,arial,s ans-serif;}
..unchecked{ font-size: xx-small;}
..checked{ font-size: xx-small; color:crimson; font-weight:bold;}
..noBorder {font-size: xx-small;}
..numeric {text-align: right;}
</style>

<script type="text/javascript">
// Change the class name of a checkbox or radio button label to
highlight checked items
function setLabelStyle(x ){
if (x.checked){
x.parentNode.cl assName="checke d";
if (x.getAttribute ("type") == "radio") {
xName = x.name;
set = document.getEle mentsByName(xNa me);
for (var i=0;i<set.lengt h;i+=1) {
if (!set[i].checked) {
set[i].parentNode.cla ssName="uncheck ed"; }
}
}
}
else{
x.parentNode.cl assName="unchec ked";
}
}

</script>

</head>
<body>
<form action="someact ion">
<center>
<table>
<tr>
<td>
<label class="unchecke d">
<input type="checkbox" id="check1"
onclick="setLab elStyle(this);" >
Abraided
</label>
<br />
<label class="unchecke d">
<input type="checkbox" id="check2"
onclick="setLab elStyle(this);" >
Incised
</label>
<br />
<label class="unchecke d">
<input type="checkbox" id="check3"
onclick="setLab elStyle(this);" >
Pecked
</label>
<br />
<label class="unchecke d">
<input type="checkbox" id="check4"
onclick="setLab elStyle(this);" >
Scratched
</label>
<br />
</td>

<td>
<label class="unchecke d">
<input type="radio" id="check21" name="myradio"
onclick="setLab elStyle(this);" >
Abraided
</label>
<br />
<label class="unchecke d">
<input type="radio" id="check22" name="myradio"
onclick="setLab elStyle(this);" >
Incised
</label>
<br />
<label class="unchecke d">
<input type="radio" id="check23" name="myradio"
onclick="setLab elStyle(this);" >
Pecked
</label>
<br />
<label class="unchecke d">
<input type="radio" id="check24" name="myradio"
onclick="setLab elStyle(this);" >
Scratched
</label>
<br />
</td>
</tr>
</table>

</center>
</form>
</body>
</html>
Mar 31 '07 #9
ASM
apparker a écrit :
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.ne twrote:
>"apparker" <adamparke...@g mail.comwrote in message

Wow that's great stuff... looks like the code is built around the
checkbox but could be altered for radios? Would it be possible to not
have the checkbox at all?
see my examples :

http://stephane.moriaux.perso.wanado...athologies.htm
http://stephane.moriaux.perso.wanado...ogies_form.htm
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Mar 31 '07 #10

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

Similar topics

3
17072
by: Matt Adams | last post by:
As well known I could specify the text color in the body tag like: <BODY TEXT=WHITE LINK=WHITE VLINK=RED ALINK=WHITE> What I want to achieve now is that always (!) the text of the last visited link and the text of the link under the cursor are red. All other links should be white. The problem with the construction above is that a visited...
4
2599
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an QA tested for a new year release. I don't think that going to prove practical, but there is no harm in trying :) and some serious family...
4
20965
by: JohnSouth104 | last post by:
Hi I want to warn the user that changing the selected item in a pull-down will clear some data he has already entered in a file download box. I've tried using confirm() to return true or false with a line such as: onchange="return(confirm('proceed Yes or No')))" but it always stops the change.
28
2567
by: Randy Starkey | last post by:
Hi, Does anyone know where I can get a script that show a little plus sign after a line of text, that when you click the plus sign, more text is revealed on that same page, like a continuing paragraph. This will be on a web page. Thanks! --Randy Starkey
2
3087
by: Cranky | last post by:
Ok, here is my scenario: I need to input numbers using my handheld IPAQ. I figured out how to create an online numeric keypad for inputting numbers into an input field, what I need to know is how I can have JS switch from one input field to another based on me clicking in the empty box. Here is my code: ########## Start of code ...
10
6056
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
4
2916
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of text and I can't find the error on why it isn't working. Any help is greatly appreciated. Here is the form
18
7734
by: wizdom | last post by:
Help - change text on click - text has another onclick inside with php variables ---------- I think what I'm trying to do is simple. I have a 2 buttons on a page. 1 button allows a thread of messages to be displayed, the other button collapses that same thread. Works fine. I was asked if I can just make it one button. I've played...
5
4441
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know if I have the entirely wrong approach, but my code is below. Any or all help is appreciated! What currently happens is that the getdivision.php...
1
7436
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7766
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5981
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5341
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4958
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1897
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
715
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.