Closed Bug 45949 Opened 24 years ago Closed 24 years ago

[FIX]Form: type="hidden" not submitted

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
Windows 95
defect

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: alan-lists, Assigned: rods)

References

()

Details

(Keywords: compat, testcase)

Attachments

(2 files)

Windows 95, Mozilla build 7-19-00

Hidden elements like:
<input type="hidden" name="test code">
Don't get submitted like NS 4.x

If you need to test submit this form I can mail results back to you to see.
http://www2.heifer.org/test/moz-form.htm
(just don't do it to me to much :) )

That page has 3 hidden elemens that are not passed to the old stand by CGI form 
FORMMAIL.CGI.  They are:
  Assigned E-Mail Account
  Network Account
  test code

Netscape 4.x sends formail.cgi the 3 hidden elements thus they appear on the 
e-mail sent back.

Mozilla does not send that information back.

Thus there could be cases where information is for some types of forms being 
processed information could almost be invalid.
Status: NEW → ASSIGNED
When I submit the form in the attachment from Nav 4.x the post looks like this:
http://pollmann.net/echo.cgi?myhidden1=++&myhidden2=++

When I submit the form in the attachment from Moz the post looks like this:
http://pollmann.net/echo.cgi?myhidden1=&myhidden2=
Here is the diff for the fix:

Index: nsFormFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/html/forms/src/nsFormFrame.cpp,v
retrieving revision 3.122
diff -r3.122 nsFormFrame.cpp
1092,1094c1092,1102
<               nsString* convValue = URLEncode(newValue, encoder);
<               buf += *convValue;
<               delete convValue;
---
>               PRInt32 type;
>               child->GetType(&type);
>               if (NS_FORM_INPUT_HIDDEN == type && newValue.Length() == 0) {
>                 nsAutoString empty;
>                 empty.AssignWithConversion("++");
>                 buf += empty;
>               } else {
>                 nsString* convValue = URLEncode(newValue, encoder);
>                 buf += *convValue;
>                 delete convValue;
>               }
Keywords: nsbeta3, review
Summary: Form: type="hidden" not submitted → [FIX]Form: type="hidden" not submitted
Target Milestone: --- → M17
As can be seen by the attachements, Mozilla is currently acting as per the
standards. Sending "++" is wrong if the value is "" (or not specified).

Marking WORKSFORME, tested with Mozilla and Commerical bits 2000072120 on Win2k.

Alan: Please reopen this if you still have the problem in the latest builds,
this time including a minimised test case. I would suggest the problem may be
with your server side script.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Keywords: nsbeta3, reviewcompat, testcase
Resolution: --- → WORKSFORME
Incidentally, I examined the issue a bit closer (since Alan asked me to) and
discovered the following:

1. IE does it like Mozilla, so we do not have a legacy to support. 86% market 
   share and all that... ;-) 

2. The script in question, formmail.pl (available from 
      http://www.worldwidemart.com/scripts/
   ...) is actually explicitly looking for empty values to not include them.

3. According to the standards (HTML), we should NOT be returning "  " when the
   value is "".
Keywords: verifyme
yup, stupid Netscape thing compaired to other platforms 
marking verifed works
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: