devnull
|
|
« on: November 01, 2012, 08:06:23 PM » |
|
Because the default for a combobox, numberspinner etc is set as the input "value" attribute, when you clear the form form('clear') the value also gets cleared and so the field is then null.
Can this behavior be changed so that when a form is cleared, the combo box, number spinner etc default to their default values and not null ? - or add anew method reset() which sets all controls on the form to their default state / values ??
Thanks
|
|
« Last Edit: May 20, 2013, 11:23:03 PM by devnull »
|
Logged
|
-- Licensed User --
|
|
|
stworthy
|
|
« Reply #1 on: November 02, 2012, 01:53:00 AM » |
|
The attached file is the simplest extension of reset method. It will be improved and integrate into next version.
|
|
|
Logged
|
|
|
|
devnull
|
|
« Reply #2 on: November 02, 2012, 01:55:37 AM » |
|
Thanks, but when I click on the file attachment I get:
"You are not allowed to access this section" even though I am logged in !
|
|
|
Logged
|
-- Licensed User --
|
|
|
stworthy
|
|
« Reply #3 on: November 02, 2012, 02:01:43 AM » |
|
Try refreshing the page and download it again.
|
|
|
Logged
|
|
|
|
devnull
|
|
« Reply #4 on: March 14, 2013, 05:02:26 AM » |
|
The function included into the latest release is acting like clear() and not reset() http://jsfiddle.net/uAqKG/2/When the form is reset, the default values for combobox, numberspinner etc etc should be reset to their default, instead, they are being cleared. Thanks
|
|
|
Logged
|
-- Licensed User --
|
|
|
|
devnull
|
|
« Reply #6 on: March 14, 2013, 04:20:44 PM » |
|
Thanks But that is not really very practical, as it means for a combobox, you need to set BOTH the value and the selected option to be identical. Instead of using the value field, why not get and use the Selected Option from the element's field array instead Thanks
|
|
|
Logged
|
-- Licensed User --
|
|
|
stworthy
|
|
« Reply #7 on: March 14, 2013, 05:53:04 PM » |
|
The selected option item is not the original value. Otherwise the original value may be changed when users load a new data set.
|
|
|
Logged
|
|
|
|
devnull
|
|
« Reply #8 on: May 20, 2013, 05:28:34 AM » |
|
Hi again: http://jsfiddle.net/uAqKG/5/Is it possible to apply the reset method to the datebox as well as combobox so that during a form reset, it's value does not get cleared. Thanks
|
|
|
Logged
|
-- Licensed User --
|
|
|
stworthy
|
|
« Reply #9 on: May 20, 2013, 06:31:18 AM » |
|
|
|
|
Logged
|
|
|
|
devnull
|
|
« Reply #10 on: May 20, 2013, 06:02:46 PM » |
|
Thanks so much, but unfortunately this does not work when the value is set programatically: http://jsfiddle.net/uAqKG/8/
|
|
« Last Edit: May 20, 2013, 06:07:20 PM by devnull »
|
Logged
|
-- Licensed User --
|
|
|
stworthy
|
|
« Reply #11 on: May 20, 2013, 06:27:43 PM » |
|
Please refer to http://jsfiddle.net/uAqKG/10/. The original value is stored when datebox is created first. Calling 'setValue' method can only change its current value. So you need to create datebox with 'value' set to the original value. $('#date1').datebox({value:$.fn.datebox.defaults.formatter(g_now)});
|
|
|
Logged
|
|
|
|
|