Make "FormManager" use form's "action" attribute, when "url" not set when configuring that form

Components

Labels

Description

FormManager is a JavaScript class, that is used by In-Portal be able to perform real-time form data validation and submission.

Right now it takes form data and sends it (along with OnCreateAjax or similar event) to homepage. Fact, that form data is sent to homepage instead of current page (where form was submitted) might seem strange, but it doesn't really change much because event, which would do data processing doesn't care about url from where it was submitted.

Recently I stumbled upon problem, that forces me to reconsider url to which form is being submitted via AJAX. The unit I was writing wasn't able to complete it's task without several other units being present on page url as well. Since the url where submission was made wasn't having these units, then as a result event ended up with a Fatal Error.

After a bit of coding I ended up with following submission url detection scheme:

  1. use url, specified during form configuration (via FormManager::registerForm method)

  2. if missing, then use url from action attribute of form, that will be submitted

  3. if missing, then use homepage url as before

Context Information

None

Additional information (do not use)

None

Attachments

1

Activity

Alex July 20, 2015 at 11:14 AM

Closing issues from released versions.

[API] Administrator May 25, 2013 at 12:27 PM

User committed a fix to 1.2.x. Commit Message:

Fixes - FormManager (js) not using "action" attribute of a form

Alex May 25, 2013 at 12:25 PM

Dmitry will test all together later.

Fixed

Details

Priority

Assignee

Reporter

Developer

Reviewer

Change Log Group

Changed

Change Log Message

Patch Instructions

Patches must be submitted through Phabricator.

Story Points

Fix versions

Created May 25, 2013 at 12:20 PM
Updated December 30, 2024 at 2:21 AM
Resolved May 25, 2013 at 12:27 PM