Open Bug 1792581 Opened 2 years ago Updated 1 year ago

Incorrect input value after form submit

Categories

(Core :: DOM: Forms, defect, P3)

Firefox 105
defect

Tracking

()

UNCONFIRMED

People

(Reporter: codalia.dubya, Unassigned)

Details

(Keywords: testcase-wanted)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Steps to reproduce:

In my app I've come across a very weird behaviour/bug when submiting a form through AJAX.
This is (partially) the form inputs just before submiting the form.

<select name="_subscription_payment_status" id="payment-status" class="form-control">
<option value="pending">Pending</option>
<option value="completed" >Completed</option>
<option value="cancelled" >Cancelled</option>
</select>

<input type="hidden" name="_subscription_payment_id" value="4">
<input type="hidden" name="_subscription_transaction_id" value="OFFL6332f0539f5c3">
<input type="hidden" name="_subscription_payment_mode" value="cheque">
<input type="hidden" name="_subscription_item_code" value="subscription">
<input type="hidden" name="_subscription_amount" value="70.00">
<input type="hidden" name="_payment_item_type" id="payment-item-type" value="subscription">
<input type="hidden" name="_current_status" id="current-status" value="pending_subscription">

Actual results:

And this is the POST data retrieved by my PHP function just after the form is submited.

Array
(
[_session_key] => pF45IGP43rf4W1PDtT6bJIyqLbW7ufZfWCBgTagn
[_token] => vaTN9khuNXrqPiNxHeFrtmFKjsktB3U8nAyTIaxg
[Member] => Array
(
[status] => pending_subscription
[created_at] => 2022-09-27 09:12:03
[updated_at] => 2022-09-27 09:13:17
[profile] => Array
(
[birth_date] => 1965-09-10 00:00:00
)

    )

[_subscription_payment_status] => completed
[_subscription_payment_id] => 3
[_subscription_transaction_id] => OFFL6332c11403d85
[_subscription_payment_mode] => cheque
[_subscription_item_code] => pending_subscription
[_subscription_amount] => 70.00
[_payment_item_type] => subscription
[_current_status] => pending_subscription

)

Expected results:

All the variable values are correct except for the _subscription_item_code. The "pending_subscription" value is returned instead of the "subscription" value.
Of course I've checked all possible variable overwrite as well as Javascript code capable of altering value on the last minute. But everything is ok.
Moreover, all of the values returned by this form are correct in both Chrome and Edge.

Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Forms' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Forms
Product: Firefox → Core

Hi,

Do you have a complete example, including the code that submits the form, and ideally a working page that we can test on? Based on what you've included, I don't have enough information to try and reproduce.

Thanks.

Flags: needinfo?(codalia.dubya)

(In reply to Kris Maglione [:kmag] from comment #2)

Hi,

Do you have a complete example, including the code that submits the form, and ideally a working page that we can test on? Based on what you've included, I don't have enough information to try and reproduce.

Thanks.

Hi and thanks for your reply.

A complete example would be difficult to provide as the application is pretty complex.
This application plugin has been developed for Winter CMS, a CMS based on the Laravel framework.
However, here are 2 links to my Github repository.

https://github.com/Duddy67/expertij-membership/blob/master/models/member/_payments.htm

from line 23 to 40:
The template file that creates the html form tags which are sent through AJAX.

from line 58 to 68:
The button that triggers the form sending.

https://github.com/Duddy67/expertij-membership/blob/master/controllers/Members.php

from line 269 to 300:
The function which retrieves the form data.
A var_dump has been placed just after the line 271 to get the $data variable.
The var_dump result is shown in my original post.

If the above information is not enough for you to fix this error, we can set up an online session so that I can show you the problem in situ and in real time.

Flags: needinfo?(codalia.dubya)

The severity field is not set for this bug.
:edgar, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(echen)
Severity: -- → S3
Flags: needinfo?(echen)
Keywords: testcase-wanted
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.