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

VERIFIED WORKSFORME

Status

()

Core
Layout: Form Controls
P3
normal
VERIFIED WORKSFORME
18 years ago
18 years ago

People

(Reporter: Alan S. Jones, Assigned: rods (gone))

Tracking

({compat, testcase})

Trunk
x86
Windows 95
compat, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
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.
(Assignee)

Comment 1

18 years ago
Created attachment 11638 [details]
simple form with two hidden fields
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

18 years ago
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=
(Assignee)

Comment 3

18 years ago
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
(Assignee)

Updated

18 years ago
Target Milestone: --- → M17
Created attachment 11797 [details]
Another testcase, this time with some text for one of the hidden fields
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
Last Resolved: 18 years ago
Keywords: nsbeta3, review → compat, 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
(Reporter)

Comment 7

18 years ago
yup, stupid Netscape thing compaired to other platforms 
marking verifed works
Status: RESOLVED → VERIFIED
(Reporter)

Updated

18 years ago
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.