Opened 12 years ago

Closed 12 years ago

#4405 closed defect (invalid)

formToObject doesn't add form input="submit" values

Reported by: blade Owned by: James Burke
Priority: high Milestone: 1.0
Component: IO Version: 0.9
Keywords: formToObject Cc:
Blocked By: Blocking:

Description

<form action="test.php" method="get">
    <input type="text" name="test1" value="value1" />
    <input type="submit" name="test2" value="value2" />
</form>

When submitting this form via xhrGet the address returned is "test.php?test1=value1" The address should be "test.php?test1=value&test2=value2"

formToObject() does not collect submit values when it should.

I marked this this priority as high because it is a major component in forms and submitting data. Giving the user the choice between two or more submits is critical.

Example: Would you like to "preview" or "submit ticket"? Submit Ticket.

Change History (1)

comment:1 Changed 12 years ago by James Burke

Priority: highnormal
Resolution: invalid
Status: newclosed

I don't think formToObject should collect submit types, since the main use of formToObject is to use it for requests to the server, and when a form is normally submitted to the server (via a normal, HTML-based submit), all of the submits are not sent, just the one that is clicked to submit the form.

If you want to include the submit type that was clicked in the form, perhaps intercept click actions on those input types, do the dojo.formToObject() call, then add the info for that specific submit type, cancel the event, then send your form-based object to the server via one of the dojo.xhr* calls.

Closing for now, but feel to reopen if you have new information.

Note: See TracTickets for help on using tickets.