Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-63859

forms with enctype="application/x-www-form-urlencoded" are submitted with Content-Type: multipart/form-data

    Details

      Description

      {markdown}
      When I attempt to submit the following form in Liferay, SennaJS takes over and submits it with `Content-Type: multipart/form-data`:

      <form id="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6" name="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6" method="post" action="http://localhost:8080/web/guest/home?p_auth=qCAXJQyR&p_p_id=com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_id=column-1&p_p_col_count=2&com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q_facesViewIdRender=%2FWEB-INF%2Fviews%2FportletViewMode.xhtml" enctype="application/x-www-form-urlencoded">
      <input name="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6" value="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6" type="hidden">
      <input name="javax.faces.encodedURL" value="http://localhost:8080/web/guest/home?p_p_id=com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=2&com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6qjsfBridgeAjax=true&_com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6qfacesViewIdResource=%2FWEB-INF%2Fviews%2FportletViewMode.xhtml" type="hidden"> <span id="_com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6:firstNameField">
      <input id="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6:firstName" name="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6:firstName" type="text">
      <input name="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:j_idt6:j_idt8" value="submit" type="submit"></span><input name="javax.faces.ViewState" id="com_liferay_faces_demos_JSFPortlet_INSTANCE_SHGY7PG0fb6q:javax.faces.ViewState:0" value="2416168134113970173:-9124742502595721809" autocomplete="off" type="hidden">
      </form>

      However, when I add `data-senna-off="true"` to the form, it works correctly.

      The form is being selected by the following code: https://github.com/liferay/liferay-portal/blob/master/modules/apps/platform/frontend/frontend-js-spa-web/src/main/resources/META-INF/resources/liferay/app/App.es.js#L15

      However, when a developer specifies the `enctype` themselves or specifies some other `enctype` besides `multipart/form-data`, perhaps SennaJS should not select it.{markdown}

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                3 years, 24 weeks, 1 day ago

                Packages

                Version Package