This is a discussion on "[SOLVED] Change Input Textbox Background Color" within the JavaScript Forum section. This forum, and the thread "[SOLVED] Change Input Textbox Background Color are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Change Input Textbox Background Color
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] Change Input Textbox Background Color
I have a web page with a checkbox and a textbox. When I check/uncheck the checkbox, I want to disable/enable the textbox and change the textbox background color.
I am using the code below. It works except the color change is not apparent until I physically click on the textbox. Can I make the color change happen immediatly when I change the checkbox?
Last edited by karinne; Nov 19th, 2007 at 16:48. Reason: Please use vBcode when pasting code in your post ;) |
|
|
|
#2
|
||||
|
||||
|
Re: Change Input Textbox Background Color
Maybe add onkeypress="ChkCb()"
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
#3
|
|||
|
|||
|
Re: Change Input Textbox Background Color
Got a link to the page in question?
Would really help. And why is this " Format="TEXT/CSV" S-Label-Fields="TRUE" --> " sitting randomly in the middle of the page? Maybe take that out? |
|
#4
|
|||
|
|||
|
Re: Change Input Textbox Background Color
And why is this " Format="TEXT/CSV" S-Label-Fields="TRUE" --> " sitting randomly in the middle ...
I deleted some comments when I pasted the code to this forum; I apparently missed the tail end of this comment. This was not the problem. Maybe add onkeypress="ChkCb()" Onkeypress does not seem to work either; but, this did work: Split the disabling and the color change into two functions. Use the checkbox onchange event to disable/enable the textbox, and use the forms onkeyup and onmouseup events to change the textbox color. |
|
#5
|
||||
|
||||
|
Re: Change Input Textbox Background Color
This is solved tehn? if you could mark it as solved via thread tools that would be great
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change Background colour based on input | smudge618 | JavaScript Forum | 2 | Feb 6th, 2008 11:55 |
| [SOLVED] Change div background on hover of another element | Aso | JavaScript Forum | 10 | Dec 8th, 2007 11:08 |
| Input textbox background trouble | sanstepsan | Starting Out | 1 | Feb 17th, 2007 21:27 |
| A way to change background color of a menu list | gohankid77 | Web Page Design | 1 | Oct 12th, 2004 10:14 |
| Anybody know how to change the color of a text input form in | Physt | Web Page Design | 7 | Aug 16th, 2004 08:44 |