Bug 28 - Interest value doesn't get initialized when the form is resetted
Summary: Interest value doesn't get initialized when the form is resetted
Status: VERIFIED FIXED
Alias: None
Product: Interest Calculator
Classification: Web
Component: Web Interface (show other bugs)
Version: 0.1.4
Hardware: All All
: Normal (P3) normal (vote)
Target Milestone: 0.3.0
Assignee: Administrator
QA Contact: Administrator
URL: http://sotirov-bg.net/apps/calc/icalc/
Whiteboard:
Keywords: interface
Depends on:
Blocks:
 
Reported: 2006-07-19 14:03 EEST by Georgi D. Sotirov
Modified: 2015-08-05 12:10 EEST (History)
0 users

See Also:
My Bug ID:
My description:
My date:
My choice:
My selection: ---


Attachments
A possible solution for the problem (928 bytes, text/html)
2006-12-05 18:01 EET, Georgi D. Sotirov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georgi D. Sotirov 2006-07-19 14:03:32 EEST
Whey you reset the calculator form the Interest field didn't get initialized and is empty. Normaly the field should be inititalized with the default interest reate corresponding to the selected currency and type.
Comment 1 Georgi D. Sotirov 2006-12-05 12:26:20 EET
It turns out that on reset the form is finally initialized with the default value for the field no matter if the value is changed (by script for example). Even if the default value is not set (empty string value), this will be the field value if the form is reseted. Observations made on Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/2006101023 Firefox/2.0, but I think this is valid for all Gecko releases to date and all Gecko based browsers.
Comment 2 Georgi D. Sotirov 2006-12-05 18:01:54 EET
Created attachment 40 [details]
A possible solution for the problem

This example shows that JavaScript code can change the defaultValue DOM element of  an HTML form input, so it is initialized with this value when the form is reseted.
Comment 3 Georgi D. Sotirov 2006-12-05 22:43:27 EET
The idea from the attachment 40 [details] was used, but I had to overcome some other issues with the form default values. When doReset() was invoked it read the old values, before the form is initialized, so I had to find the default form values and use them to reset the form properly.


bug/show.html.tmpl processed on May 18, 2024 at 22:01:36.
(provided by the Example extension).