From 77713388ef2047ddb6297e6457731a9d3e9efc3a Mon Sep 17 00:00:00 2001 From: Nick Fenwick Date: Wed, 29 Sep 2021 12:14:58 +0700 Subject: [PATCH] Use this.name properly so widget in form behaves. --- form/Rating.js | 4 ++-- form/tests/test_Rating.html | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/form/Rating.js b/form/Rating.js index 95953f24c0..ee1b5d0f54 100644 --- a/form/Rating.js +++ b/form/Rating.js @@ -36,12 +36,12 @@ define([ // Build the templateString. The number of stars is given by this.numStars, // which is normally an attribute to the widget node. - var radioName = 'rating-' + Math.random().toString(36).substring(2); + this.name = this.name || 'rating-' + Math.random().toString(36).substring(2); // The radio input used to display and select stars var starTpl = ''; // The hidden value node is attached as "focusNode" because tabIndex, id, etc. are getting mapped there. diff --git a/form/tests/test_Rating.html b/form/tests/test_Rating.html index 4d6debd998..a6d9ec1899 100644 --- a/form/tests/test_Rating.html +++ b/form/tests/test_Rating.html @@ -90,16 +90,24 @@

Inside a dojo form

dojo.require("dijit.form.FilteringSelect"); dojo.require("dijit.form.Button"); -
+

-
+


- + +

+ The value is: 0 + The form value is: -empty-