By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,382 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,382 IT Pros & Developers. It's quick & easy.

recognize the change of controls value in javascript

P: n/a
hi.
Is there any body to help me?
I am writing a web program.
I have some forms.
each form have some controls and users can edit the controls.
finally they can save their forms.
I would like to add an ability to my program.
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
I want to write my code with javascript and I wouldn't like to work
with the server.
In fact all the story happen at the clients side.
I think that checking the Control's value with values of Database or a
copy of database that exist in memory in the specific time is not a
good way.

Jun 20 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Jun 20, 5:19 pm, raha <bighamor...@gmail.comwrote:
hi.
Is there any body to help me?
I am writing a web program.
I have some forms.
each form have some controls and users can edit the controls.
finally they can save their forms.
I would like to add an ability to my program.
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
I want to write my code with javascript and I wouldn't like to work
with the server.
In fact all the story happen at the clients side.
I think that checking the Control's value with values of Database or a
copy of database that exist in memory in the specific time is not a
good way.
Maybe using the onchange event on the inputs?

Jun 20 '07 #2

P: n/a
Darko said the following on 6/20/2007 1:58 PM:
On Jun 20, 5:19 pm, raha <bighamor...@gmail.comwrote:
>hi.
Is there any body to help me?
I am writing a web program.
I have some forms.
each form have some controls and users can edit the controls.
finally they can save their forms.
I would like to add an ability to my program.
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
I want to write my code with javascript and I wouldn't like to work
with the server.
In fact all the story happen at the clients side.
I think that checking the Control's value with values of Database or a
copy of database that exist in memory in the specific time is not a
good way.

Maybe using the onchange event on the inputs?
That won't satisfy the desire though. If an input starts with a value of
"Default Value" and I manually change it to "Manual Value", then I
change my mind and type in "Default Value", did the value of the input
change? defaultValue is the property wanted to check against, not simply
that the value has changed.

onchange="if(this.value!=this.defaultValue){change TheIcon('changed'}else{changeTheIcon('default')}"

And then have changeTheIcon change the icon dependent on the parameter
passed to it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 20 '07 #3

P: n/a
On Jun 20, 11:41 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Darko said the following on 6/20/2007 1:58 PM:
On Jun 20, 5:19 pm, raha <bighamor...@gmail.comwrote:
hi.
Is there any body to help me?
I am writing a web program.
I have some forms.
each form have some controls and users can edit the controls.
finally they can save their forms.
I would like to add an ability to my program.
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
I want to write my code with javascript and I wouldn't like to work
with the server.
In fact all the story happen at the clients side.
I think that checking the Control's value with values of Database or a
copy of database that exist in memory in the specific time is not a
good way.
Maybe using the onchange event on the inputs?

That won't satisfy the desire though. If an input starts with a value of
"Default Value" and I manually change it to "Manual Value", then I
change my mind and type in "Default Value", did the value of the input
change? defaultValue is the property wanted to check against, not simply
that the value has changed.

onchange="if(this.value!=this.defaultValue){change TheIcon('changed'}else{changeTheIcon('default')}"

And then have changeTheIcon change the icon dependent on the parameter
passed to it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
And if you open MS Word and find the text "Default text" and then you
change it to "Modified text" and then manually back to "Default text"
do you think it will consider the document modified or not?

Jun 21 '07 #4

P: n/a
Darko said the following on 6/21/2007 11:15 AM:
On Jun 20, 11:41 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
>Darko said the following on 6/20/2007 1:58 PM:
>>On Jun 20, 5:19 pm, raha <bighamor...@gmail.comwrote:
hi.
Is there any body to help me?
I am writing a web program.
I have some forms.
each form have some controls and users can edit the controls.
finally they can save their forms.
I would like to add an ability to my program.
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
I want to write my code with javascript and I wouldn't like to work
with the server.
In fact all the story happen at the clients side.
I think that checking the Control's value with values of Database or a
copy of database that exist in memory in the specific time is not a
good way.
Maybe using the onchange event on the inputs?
That won't satisfy the desire though. If an input starts with a value of
"Default Value" and I manually change it to "Manual Value", then I
change my mind and type in "Default Value", did the value of the input
change? defaultValue is the property wanted to check against, not simply
that the value has changed.

onchange="if(this.value!=this.defaultValue){chang eTheIcon('changed'}else{changeTheIcon('default')}"

And then have changeTheIcon change the icon dependent on the parameter
passed to it.
And if you open MS Word and find the text "Default text" and then you
change it to "Modified text" and then manually back to "Default text"
do you think it will consider the document modified or not?
Let me think on this one for a minute and consider a few things:

1) This is a Javascript Newsgroup
2) This newsgroup has nothing to do with MS Word.
3) I don't use MS Word, I use a real Word Processor.
4) What happens in Word has nothing to do with what happens in a browser
unless you are trying to emulate it.
5) I didn't change my mind after thinking about it, I still don't care
what MS Word does. If you want to know if a field has changed from it's
default value then onchange alone will not suffice.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jun 21 '07 #5

P: n/a
On Jun 21, 6:25 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Let me think on this one for a minute and consider a few things:

1) This is a Javascript Newsgroup
2) This newsgroup has nothing to do with MS Word.
3) I don't use MS Word, I use a real Word Processor.
4) What happens in Word has nothing to do with what happens in a browser
unless you are trying to emulate it.
5) I didn't change my mind after thinking about it, I still don't care
what MS Word does. If you want to know if a field has changed from it's
default value then onchange alone will not suffice.
On Jun 20, 5:19 pm, raha <bighamor...@gmail.comwrote:
In fact I want to have an Icon that change, when a user change the
value of a control of form such as textbox , radiobox, grid.
as you know the most famous and important editors such as PSPAD or
MSWORD have this ability.
Jun 21 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.