473,394 Members | 1,878 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,394 software developers and data experts.

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 3550
"apparker" <ad**********@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.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.netwrote:
"apparker" <adamparke...@gmail.comwrote in message

news:11**********************@b75g2000hsg.googlegr oups.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**********@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.netwrote:
>"apparker" <adamparke...@gmail.comwrote in message

news:11**********************@b75g2000hsg.googleg roups.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.netwrote:
"apparker" <adamparke...@gmail.comwrote in message

news:11**********************@o5g2000hsb.googlegro ups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.netwrote:
"apparker" <adamparke...@gmail.comwrote in message
>news:11**********************@b75g2000hsg.googleg roups.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...@gmail.comwrote:
On Mar 28, 9:19 pm, "-Lost" <missed-s...@comcast.netwrote:
"apparker" <adamparke...@gmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.netwrote:
>"apparker" <adamparke...@gmail.comwrote in message
>>news:11**********************@b75g2000hsg.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.

Mar 29 '07 #6
"apparker" <ad**********@gmail.comwrote in message
news:11********************@o5g2000hsb.googlegroup s.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.javascript message <11**********************@b75g2000hsg.go
oglegroups.com>, Wed, 28 Mar 2007 12:12:22, apparker
<ad**********@gmail.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.color=new Date()%0x1000000)">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.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Mar 29 '07 #8
-Lost wrote:
"apparker" <ad**********@gmail.comwrote in message
news:11********************@o5g2000hsb.googlegroup s.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,sans-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.className="checked";
if (x.getAttribute("type") == "radio") {
xName = x.name;
set = document.getElementsByName(xName);
for (var i=0;i<set.length;i+=1) {
if (!set[i].checked) {
set[i].parentNode.className="unchecked"; }
}
}
}
else{
x.parentNode.className="unchecked";
}
}

</script>

</head>
<body>
<form action="someaction">
<center>
<table>
<tr>
<td>
<label class="unchecked">
<input type="checkbox" id="check1"
onclick="setLabelStyle(this);">
Abraided
</label>
<br />
<label class="unchecked">
<input type="checkbox" id="check2"
onclick="setLabelStyle(this);">
Incised
</label>
<br />
<label class="unchecked">
<input type="checkbox" id="check3"
onclick="setLabelStyle(this);">
Pecked
</label>
<br />
<label class="unchecked">
<input type="checkbox" id="check4"
onclick="setLabelStyle(this);">
Scratched
</label>
<br />
</td>

<td>
<label class="unchecked">
<input type="radio" id="check21" name="myradio"
onclick="setLabelStyle(this);">
Abraided
</label>
<br />
<label class="unchecked">
<input type="radio" id="check22" name="myradio"
onclick="setLabelStyle(this);">
Incised
</label>
<br />
<label class="unchecked">
<input type="radio" id="check23" name="myradio"
onclick="setLabelStyle(this);">
Pecked
</label>
<br />
<label class="unchecked">
<input type="radio" id="check24" name="myradio"
onclick="setLabelStyle(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.netwrote:
>"apparker" <adamparke...@gmail.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
On Mar 31, 11:04 am, ASM <stephanemoriaux.NoAd...@wanadoo.fr.invalid>
wrote:
apparker a écrit :
On Mar 28, 8:37 pm, "-Lost" <missed-s...@comcast.netwrote:
"apparker" <adamparke...@gmail.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...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
Wow, that's crazy I'm coding something in the medical field as well.
Funny how we both thought it's be a good idea to make those texts
change color, we should compare notes sometime.

Apr 3 '07 #11

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

Similar topics

3
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...
4
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...
4
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...
28
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...
2
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...
10
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...
4
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...
18
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.