Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11221 closed defect (fixed)

dijit.form.FilteringSelect that is required, empty default value, and DOM onchange and dijit onChange events

Reported by: zcurtis@… Owned by:
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.4.3
Keywords: FilteringSelect required default onchange Cc:
Blocked By: Blocking:

Description (last modified by bill)

I have many fields in my real form that are driven (dynamically displayed) by a user selection in a drop-down field. This scenario repeats itself at different levels in the hierarchy. Based on which branches you follow, field are dynamically required as well. The onchange events handle the diplaying of dependent fields and determining which fields to require. I will attach a file that demonstrates the problem in a simplified manner. The attached works fine in 1.3.3, but fails in a number of ways in 1.4.3.

When I setup a FilteringSelect that is required and has an empty default value, a declarative DOM onchange and dijit onChange event handlers, the following problems are encountered in 1.4.3.

1) Runtime error: 'node is undefined'. Removing the attribute value='null' and replacing with defaultValue= resolves the runtime error.

2) If first item is selected in drop-down, neither event handler is triggered.

3) If a user clicks the drop down, doesn't make a selection, and then clicks elsewhere on the form, clicks submit, dijitform.validate() passes even though the user never made a selection to a required field.

Attachments (1)

DojoFilteringSelectTest.html (2.8 KB) - added by zcurtis@… 9 years ago.
Example code demonstrating success and by change of version, failure

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by zcurtis@…

Example code demonstrating success and by change of version, failure

comment:1 Changed 9 years ago by bill

Description: modified (diff)
Milestone: tbd1.5
Resolution: fixed
Status: newclosed

I tried this against 1.5, on FF3.6/mac.

1) Runtime error: 'node is undefined'. Removing the attribute value='null' and replacing with defaultValue= resolves the runtime error.

This didn't reproduce for me, using your test file against 1.5.

2) If first item is selected in drop-down, neither event handler is triggered.

You should only be using onChange, not the DOM event onchange. Anyway, on selecting the first item, I see a console.log() that there was an onChange event.

3) If a user clicks the drop down, doesn't make a selection, and then clicks elsewhere on the form, clicks submit, dijitform.validate() passes even though the user never made a selection to a required field.

Aappears to be fixed. I opened the drop down for the first select box, but then clicked elsewhere on the page to close the drop down w/out selecting anything. On pressing "submit" it displays an error message.

comment:2 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.