Clear field values

Aug 11, 2010 at 2:51 PM

This is a great solution, which I was waiting for for a long time. It works fine for me when adding a new item to a list. But... is it possible to put some extra code to the script to clear the child field values when changing the parent value after saving for the first time?

For example:  I add a row to the Cascaded Lookups demo list (title Sample 1, Account HP and Branch HP Europe) and save it. So far, so good. Situation changed: I want to edit the row and change the Account field to Microsoft. The field value of Branch still remains HP Europe. So we've got the combination of Microsoft and HP Europe now. I want to clear the value of the child field when changing the parent field after saving it for the first time. If I choose then for Microsoft as parent value then the child values belonging to Microsoft should be presented.

Thanx a lot in advance.


Aug 13, 2010 at 10:47 AM

Oh my god. Why did I post the first one? It's so simple to solve this problem. Just use the same script for the same lists' EditForm page... And that's it.

Aug 13, 2010 at 11:12 AM

Oh my god again. The solution in my second post works fine... if you change the value of the first field. But if the first field remains the same value, for example if the account HP doesn't have to be changed, but only the second field value from HP Europe to HP USA then I've got still the non clearing problem. The second field shows all the values...