Opened 13 years ago

Closed 12 years ago

Last modified 10 years ago

#666 closed defect (wontfix)

"file","submit","reset","button" not sent with form

Reported by: anonymous Owned by: James Burke
Priority: high Milestone: 1.0
Component: IO Version: browserio_package
Keywords: Cc:
Blocked By: Blocking:

Description

I really do wonder if that is the correct approach, especially as many server scripters test existence of the submit button before processing the form:

if get_request().get_field('submitBtnName') is not None:

process form

From BrowserIO.js:

only add if input of type NOT in array

else if(!dojo.lang.inArray(type, ["file", "submit", "reset", "button"])) {

values.push(name + "=" + enc(elm.value));

}

Perhaps either setting flags for send_file, send_submit etc or defining the array of unsent types elsewhere might be prudent?

regards, Mark (pending dojo fan)

Change History (4)

comment:1 Changed 13 years ago by dylan

Component: GeneralIO
Milestone: 0.5
Owner: changed from anonymous to alex

seems like a reasonable request.... perhaps a dj_config prop for this.

comment:2 Changed 13 years ago by dylan

Owner: changed from alex to James Burke

comment:3 Changed 12 years ago by James Burke

Milestone: 0.91.0

Moving this to 1.0, since the behavior is the same in 0.4.3, and we just want to get a 0.9 that matches rough parity with 0.4.3.

comment:4 Changed 12 years ago by James Burke

Resolution: wontfix
Status: newclosed

I don't think we'll provide a flag for this. Normally, the browser will just send the submit type that was actually clicked, not all submit types in the form. Additionally, I do not believe resets are sent, and file content can be sent by using the dojo.io.iframe (Dojo 0.9) and dojo.io.IframeIO (Dojo 0.4).

Ideally we could send the submit type that was clicked, but I do not believe we have access to this. A workaround (using Dojo 0.9 names here):

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.

Note: See TracTickets for help on using tickets.