You are not logged in.

#1 2006-09-19 11:51:59

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Change input text field color until saved.

How to change the background color in a text field when edited? When saving the field returns to default. The idea here, not to forget to save before editing another record or exit.
Example, date and checkbox fields are edible. At the right side, for each row is a link "save".
(click to enlarge):
thumb-app.jpg

PHP Code:
http://user-contributions.org/projects/ … er_old.txt


Markku

Offline

#2 2006-09-22 04:56:12

Cirdan
Member
Registered: 2006-03-18
Posts: 64

Re: Change input text field color until saved.

You might have to use something like AJAX...I don't know it tho.

Offline

#3 2006-09-23 06:23:25

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Re: Change input text field color until saved.

I will check if easy to install.
One other why could be something similar I am currently using when mouse is above a row. Where can I find other similar tags?

onmouseover=this.style.color="red" onmouseout=this.style.color="black"

Markku

Offline

#4 2006-09-23 23:09:56

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Change input text field color until saved.

maybe....

javascript as some sort of 'onkeypress' right? on that check if the box is empty, or changed from it's original value, and then if it has been changed, set  the style to it.

James

Offline

#5 2006-09-24 07:54:51

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Re: Change input text field color until saved.

iphitus wrote:

javascript as some sort of 'onkeypress' right?

Thanks, found a helpful script.
http://www.webdeveloper.com/forum/print … hp?t=28750

In my case I copied the shorter sample:

function ini(a){
a.style.backgroundColor = '#FFFFFF';
}
onclick="ini(this)"

Sample:

INPUT TYPE=text size="15" onclick="ini(this)" name="dateApp" value="$myrow[DateApp]

(click to enlarge):
thumb-app.jpg

PHP Code:
http://user-contributions.org/projects/ … rowser.txt


Markku

Offline

#6 2006-09-24 11:58:19

dadexter
Member
From: Dorval, QC, Canada
Registered: 2004-09-07
Posts: 274
Website

Re: Change input text field color until saved.

wouldn't onFocus and onBlur be a better idea?

Offline

Board footer

Powered by FluxBB