Closed Bug 72603 Opened 23 years ago Closed 23 years ago

Form manager captures bad values for sample2 page

Categories

(Toolkit :: Form Manager, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: morse, Unassigned)

References

()

Details

Attachments

(2 files)

From menu select tasks->privacy->form-manager->demo
Click on sample 2
Enter a value in any text field (e.g., First Name)
From menu select edit->save-form-data
From menu select edit->prefill-form

At this point you will get a preview dialog showing the values that are going to 
get prefilled.  The FirstName value is there and is correct.  But there are also 
values for Card.Type, Card.Exp.Month, and Card.Exp.Year and these values are all 
bogus (consist of line-feeds and spaces and nothing else).
Problem here is in the following html:

    <select name="Card.Type">
      <option value="">
      </option>
      <option value="V">
        Visa
      </option>
      <option value="MC">
        MasterCard
      </option>
    </select>

Assume that the last option (master card) is selected.  Form manager will 
capture both the option value ("MC") and the option text ("MasterCard") so as to 
maximize the likelyhood of finding an appropriate value in a select list on some 
other page that it is asked to prefill.

Unfortunately the option text is written across several lines.  When form 
manager does a call to GetText, it gets all the text between the <option> and 
</option> tags, including the linefeeds and leading spaces.  And if the first 
option (blank) is selected in the example above, the linefeeds and spaces are 
all it gets.  So we need to trim away leading and trailing linefeeds and spaces 
before capturing the text.

Attaching a patch that does just that.
r=jag
cc'ing alecf for super review
cc'ing alecf for super review
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9
easy enough. sr=alecf
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified fix checked into lxr.mozilla.org
Status: RESOLVED → VERIFIED
Assignee: morse → nobody
Product: Core → Toolkit
QA Contact: tpreston → form.manager
Target Milestone: mozilla0.9 → ---
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: