Closed Bug 12475 Opened 21 years ago Closed 21 years ago

[Blocker] Wallet resetting form values.

Categories

(Core :: Layout: Form Controls, defect, P1, blocker)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: desale, Assigned: morse)

References

()

Details

(Whiteboard: possible fix)

Attachments

(1 file)

For M9: TextBox as well as Select object does not hold the values assigned to
them through HTML code.
For M10: Select Object does not hold value assigned to it through HTML code.

BULDS:
M9: 08-24-13 [Apprunner]
M10: 08-24-09 [Apprunner]

STEPS TO REPRODUCE:

1] Visit URL above with both the builds [M9 as well as M10].
2] You'll see one Text Box, [Please do not input anything in the text box.]
3] You'll see one select. Please select one option from this select.
4] Click Submit button.

OR

1] Please copy "HTML" code as well as "cgi" code I'm providing belove.
2] Save these two files.
3] Make necessary changes in FORM ACTION in HTML file, according to your cgi
file location and name.
4] Open HTML file with both the builds [M9 as well as M10].
5] You'll see one Text Box, [Please do not input anything in the text box.]
6] You'll see one select. Please select one option from this select.
7] Click Submit button.

EXPECTED RESULTS:

When you open HTML file, TextBox should show value "TextValue" since its
assigned to TextBox in HTML code itself.

After Clicking Submit Button you should see

Text Box Value is: TextValue
Select Value is: SelectValue1 [Considering first option is selected]

ACTUAL RESULTS:

M9:
on opening HTML page, TextBox does not show any value. [This means its not
holding value assigned to it through HTML code.]

After Clicking Submit Button,

Text Box Value is:
Select Value is:
[This means, TextBox as well as Select are not holding their values]

M10:
on opening HTML page, TextBox does show its value. [This is different than M9
results]

After Clicking Submit Button,

Text Box Value is: TextValue
Select Value is:
[This means, TextBox does hold its value, but select does not hold its value.]

HTML CODE:

<html>
<head>
<title>VALTEST</title>
</head>
<script>
<!--
function SubForm(){
document.workform.submit();
}
//-->
</script>
<body bgcolor="#FFFFFF" text="#000000" >
<form name="workform" action="/ngdriver/cgi-bin/foo1.cgi" method="post">
Text Box<input type="text" name="temptext" value="TextValue" size="40"><br>
Select Something Here<select name="tempsel" multiple>
<option value="SelectValue1">Option1</option>
<option value="SelectValue2">Option2</option>
<option value="SelectValue3">Option3</option>
</select><br>
<input type=button name="button2" value="Submit" onclick="SubForm();">
</form>
</body>
</html>

END OF HTML CODE:

CGI CODE:

#!/usr/local/bin/perl
require "cgi-lib.pl";
print "Content-type: text/html", "\n\n";
MAIN:
{

&ReadParse(*input);
$resultsdir = "results";
$textval = $input{'temptext'};
$selval = $input{'tempsel'};

print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>CGI Test</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<H2>Text Box Value is:    $textval</H2><br>\n";
print "<H2>Select Value is:    $selval</H2><br>\n";
print "</BODY>\n";
print "</HTML>\n";
}
exit(0);

END OF CGI CODE:


Other object like "hidden", "Checkbox", "Radio", does not have any problem.
Viewer works fine.
Tested on Win-95, WinNT, Mac, Linux.
Priority: P3 → P1
Setting priority to P1.
Assignee: vidur → pollmann
Component: DOM Level 0 → HTML Form Controls
Assigning to Pollmann since it's form related- this has nothing to do with the
DOM.

I know there were problems with POST submission of forms in M9 - I believe they
have been fixed since. If anything, there might still be problems with form
submission as a whole.
Attached file test case
Status: NEW → ASSIGNED
Hardware: PC → All
Summary: [Blocker] TextBox and Select objects not holding values with apprunner. → [Blocker] <SELECT> not submitting value.
Target Milestone: M10
As described in the bug report, I am able to reproduce the select portion of
this bug.  Changing summary to reflect status.
Thank you Prashant, I received your voicemail - I'm working on this bug - I have
everything I need and hope to have it narrowed down shortly!
Whiteboard: possible fix
I think I've got a handle on this.  The logic that determines whether to use a
combobox or a listbox was changed recently - this was causing a combobox to be
wrongly created for this case, and that broke logic elsewhere down the line.

I've corrected the combobox/listbox selection logic and will check this one in
shortly.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Just checked in a fix.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Eric, I tested it with todays builds. [1999-08-27-09-M10, Apprunner].
I'm affraid that its not been fixed yet.
Select as well as Text Box is still not holding their values. there is something
wrong in submitting <SELECT> values also.
Funny thing is, when I load page, textbox does not show any value inside it,
even though its assigned some value through HTML code. but If I write something
in text box and try to submit, then its submitting that value.
I think its something like objects are not holding values.

Reopening bug.
Status: REOPENED → ASSIGNED
Hmm, the select is working for me.  Is it for you?

I am not also able to reproduce the text disappearing.  I have a really slow
machine, so I can see 1) the widget is created 2) the text of the widget is set
to "TextValue" 3) the text of the widget is cleared out

I looking at it.
s/not able/now able/  I really do see this bug!  :)
No Eric, Select is not working for me.
I'm not sure where problem is, but I really believe its related to something
related to objects holding the values, coz otherwise Textbox won't loose its
value on load.
I can reproduce it on my machine as well as machines in lab.
Somehow, both objects are not holding values, and thats the reason we don't see
these vales after submission. I think its not a problem in submission process.
Its just a value which is not there to submit.
After submission also, you can see search filed in URL is empty. If there was a
problem in submission then atleast search field should show value assigned to it
while submission. You can observe that through content length also.
Oh OK, so you saw this bug. I guess we both were trying to submit info at
same time.
Eric,

I'm providing one very good testcase which will prove that on loading page
objects hold value and after some time they loose their values.

STEPS TO FOLLOW:
1] Copy code I'm providing and save it as HTML file. Open this HTML file with
apprunner. [Do this on Win95, coz I just tested it with win95]
2] onLoad you'll see one alert which shows values of textbox and select.
3] You'll see one button "Now Again Check Values".
5] click this button.

EXPECTED RESULTS:
Since I'm calling same alert on click of this button which I called onLoad of
page, so it should show me same results.

ACTUAL VALUES:
alert onLoad shows values of text box as well as select.
alert on click of button does not show values of text box and select.

DESCRIPTION:
This means, after loading page completely, textbox and select are loosing their
values.

CODE:

<HTML>
<HEAD>
<TITLE>Document Test</TITLE>
</HEAD>
<SCRIPT>
<!--
function show(){
alert("Text Value="+document.workform.temptext.value + "    and Select Value=" +
document.workform.tempsel.options[0].value );
}
//-->
</SCRIPT>
<BODY onLoad="show();">
<FORM NAME="workform">
<INPUT TYPE="text" NAME="temptext" VALUE="TextValue">
<SELECT NAME="tempsel">
<OPTION VALUE="option1">Opt1</OPTION>
<OPTION VALUE="option2">Opt2</OPTION>
</SELECT>
<INPUT TYPE="button" NAME="tempbut" VALUE="Now Again Check Values"
onClick="show();">
</FORM>
</BODY>
</HTML>

END OF CODE:
Wild.  I don't know what's up here - this is happening on all platforms (Linux
and NT too at least), but only in apprunner, not viewer.  Still trying to track
this down.  Thanks.
Yeah. It happens only in apprunner. Viewer is fine.
Assignee: pollmann → morse
Status: ASSIGNED → NEW
Summary: [Blocker] <SELECT> not submitting value. → [Blocker] Wallet resetting form values.
Well, interestingly, I set a breakpoint in nsHTMLInputElement::SetValue.
Looks like Wallet is resetting the value to null when OnEndDocumentLoad is
called.  Steve?
*** Bug 12700 has been marked as a duplicate of this bug. ***
Status: NEW → RESOLVED
Closed: 21 years ago21 years ago
Resolution: --- → FIXED
Yep, this was my bug.  I just checked in a new version of
extensions/wallet/src/nsWalletService.cpp to correct this.
Status: RESOLVED → VERIFIED
Yeah, Its working really fine. Thanks for working so quickly on this one.
Marking verified.
You need to log in before you can comment on or make changes to this bug.