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

Changes ???

P: n/a
Is there anyway to tell if some of the content of a form has changed in
anyway?

For example, I have a form with some <input> elements, to include
<input type="text"... >, and <select ...>. Let's call this the "parent"
form.

On that "parent" form there is a link for a pop-up. The pop-up has
another form for data input. This "child" form has functionality that
save and then attempts to refresh the "parent" form just before it
closes.

The problem is some users do data input into the "parent" form inputs
and then press the link opening up the "child". Well you can guess it,
the data inputs are lost because the parent form gets refreshed.

So, If I know if any of the content of the parent form has changed,
then instead of executing a refresh I can save first.

Any ideas? What I'd hate to so is carte-blanc save the form inputs
every time.

Mike

Sep 14 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a

"mike" <hi****@charter.net> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Is there anyway to tell if some of the content of a form has changed in
anyway?

For example, I have a form with some <input> elements, to include
<input type="text"... >, and <select ...>. Let's call this the "parent"
form.

On that "parent" form there is a link for a pop-up. The pop-up has
another form for data input. This "child" form has functionality that
save and then attempts to refresh the "parent" form just before it
closes.


here is your problem, why do you refresh the parent when the child chages ?

you could save the form before the page is refreshed or loaded but this is a
waste of resources.

instead of refreshing the parent just use dhtml to edit...
Sep 14 '05 #2

P: n/a

"mike" <hi****@charter.net> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Is there anyway to tell if some of the content of a form has changed in
anyway?

For example, I have a form with some <input> elements, to include
<input type="text"... >, and <select ...>. Let's call this the "parent"
form.

On that "parent" form there is a link for a pop-up. The pop-up has
another form for data input. This "child" form has functionality that
save and then attempts to refresh the "parent" form just before it
closes.

The problem is some users do data input into the "parent" form inputs
and then press the link opening up the "child". Well you can guess it,
the data inputs are lost because the parent form gets refreshed.

So, If I know if any of the content of the parent form has changed,
then instead of executing a refresh I can save first.


if you need to do this create a boolian on the page and set this when the
user chages the form using theonChange()
Sep 14 '05 #3

P: n/a
mike wrote:
Is there anyway to tell if some of the content of a form has changed
in anyway?


There is nothing built-in, but you can use my isFormModified() function
found here:
http://www.JavascriptToolbox.com/val...ns/source.html

That should give you an easy interface to determine if any form elements are
different from their default values.

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
Sep 14 '05 #4

P: n/a
Because the parent form has some information the user can update on the
child form.

For instance, there are 15 elements total, 5 of those are updated
really often so they are on the parent form, the other 10 are not. But
when the child form opens (all 15 elements are there) and updates one
of the 5 that are also on the parent, the parent data has to be changed
or the user is confounded and thinks his data was not updated because
he just changed it on the child form.

Sep 14 '05 #5

P: n/a
Matt,

Cool, let me try that.

Mike

Sep 14 '05 #6

P: n/a

"mike" <hi****@charter.net> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
Because the parent form has some information the user can update on the
child form.

For instance, there are 15 elements total, 5 of those are updated
really often so they are on the parent form, the other 10 are not. But
when the child form opens (all 15 elements are there) and updates one
of the 5 that are also on the parent, the parent data has to be changed
or the user is confounded and thinks his data was not updated because
he just changed it on the child form.
you should be using DHTML on the parents page and not saving and then
refreshing the page, it is not very ecconomical.


Sep 14 '05 #7

P: n/a
Talk to me about that .... what are you recommending?

Sep 14 '05 #8

P: n/a

"mike" <hi****@charter.net> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Talk to me about that .... what are you recommending?


Well you create a function in the parent window called something like
applyChanges()

When the child window is saved make a call to applyChanges() and use
JavaScript to update the form elements. You can pass in the values to
applyChages() or get applychanged on the parent winow to read the child
window.

See ?
Sep 14 '05 #9

P: n/a
Yep, I see that...

Sep 14 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.