Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support formaction attribute #40

Open
nprieto95 opened this issue Jul 26, 2018 · 28 comments
Open

Support formaction attribute #40

nprieto95 opened this issue Jul 26, 2018 · 28 comments
Labels
cost: S Will take up to 2 days to complete investigate PRI: 2 - Preferred Preferably should be handled during the milestone. question
Milestone

Comments

@nprieto95
Copy link

This is an issue in support of the PR #36 . I hereby present a concrete case in which my personal experience with the product would improve if the functionality shown in that PR was merged.

Currently, when having a form like this one:

<form action="/Management/Products/Edit/A001"
    data-ajax="true"
    data-ajax-method="Post"
    data-ajax-mode="replace"
    data-ajax-update="#preview-container"
    id="form0" method="post">
    <div class="row">
        <section class="col-md-9">
            <h2>Edit</h2>
            <div class="form-row">
                <div class="form-group col-md-12">
                    <label for="Name">Name</label>
                    <input class="text-box single-line" id="Name" name="Name" type="text" value="Test" />
                </div>
            </div>
        </section>
        <section class="col-md-3">
            <h2>Preview</h2>
            <div id="preview-container">
                <product-card code="A001" name="Test"></product-card>
            </div>
        </section>
    </div>
    <a class="btn btn-dark" href="/Management/Products">Cancel</a>
    <button type="submit" class="btn btn-secondary" formaction="/Management/Products/Preview">
        Preview
    </button>
    <button type="submit" class="btn btn-success">
        Save
    </button>
</form>

clicking on the "Preview" button causes a request to be isssued to /Management/Products/Edit/A001 instead of /Management/Products/Preview . The second case would be desired as that is the destination that would be hit if we were using synchronous, old-style forms without unobtrusive jquery-ajax support.

Supporting formaction natively would eliminate the need to sometimes come up with workarounds to use a library that is really good in every other aspect I had the chance to encounter.

@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @nprieto95.
@kichalla, I was under the impression that even today this is possible, wasn't it?

@kichalla kichalla added 2 - Working cost: S Will take up to 2 days to complete labels Aug 3, 2018
@kichalla
Copy link
Member

kichalla commented Aug 3, 2018

@nprieto95 Could you share a standalone repro project that can represent the issue you are seeing?

@mkArtakMSFT
Copy link
Member

Hi. We're closing this issue as no response or updates have been provided in a timely manner and we have been unable to reproduce it. If you have more details and are encountering this issue please add a new reply and re-open the issue.

@kakone
Copy link

kakone commented Sep 5, 2018

@nprieto95 You can reopen this issue.
The problem is very simple, the formaction attribute on button or input is not taken into account : http://plnkr.co/edit/lc82fluYOGguSHIeKJs2?p=preview
When you click on the "Submit to another page" button, the formaction value ("another_action.html") should be called. It's not the case. The PR #36 corrects this.

@mkArtakMSFT mkArtakMSFT reopened this Sep 21, 2018
@mkArtakMSFT mkArtakMSFT added this to the 3.2.5 milestone Sep 21, 2018
@mkArtakMSFT mkArtakMSFT added the PRI: 2 - Preferred Preferably should be handled during the milestone. label Sep 21, 2018
@mkArtakMSFT
Copy link
Member

@javiercn. can you please verify this and review the PR? Thanks!

@mkArtakMSFT mkArtakMSFT modified the milestones: 3.2.5, 3.2.6, 3.2.7 Oct 5, 2018
@drml
Copy link

drml commented Mar 16, 2019

Any progress on this? The PR #36 fixing the issue is literally just one line of code, if I understand.

@kakone
Copy link

kakone commented Apr 10, 2019

Any progress on this? The PR #36 fixing the issue is literally just one line of code, if I understand.

We will celebrate soon the 1 year of this PR of one line of code. Too bad there was not 5 minutes in 1 year to merge this PR 😢

@vanillajonathan
Copy link

@mkArtakMSFT, @javiercn, @ryanbrandenburg, ping!

@Stormgail
Copy link

Just wanted to add that fixing this would be a big help for my team

@kakone
Copy link

kakone commented Jan 15, 2020

Just wanted to add that fixing this would be a big help for my team

I think you should update the line of code by yourself and not use the npm package anymore. You must just replace the line url: this.action by url: clickTarget && clickTarget.attr('formaction') || this.action.
Don't expect the pull request to be merged, we've been waiting for it a year and a half.

@Stormgail
Copy link

Just wanted to add that fixing this would be a big help for my team

I think you should update the line of code by yourself and not use the npm package anymore. You must just replace the line url: this.action by url: clickTarget && clickTarget.attr('formaction') || this.action.
Don't expect the pull request to be merged, we've been waiting for it a year and a half.

Thanks, I did exactly that but thought it wouldn't hurt to at least mention it'd be useful

@kakone
Copy link

kakone commented Feb 7, 2020

I now also added the support of the formmethod attribute in the PR #36.

@alden-m
Copy link

alden-m commented May 8, 2020

That's insane, two years for one line of code :)

@akifyanbak
Copy link

That's insane, two years for one line of code :)

Lol 😂

@vanillajonathan
Copy link

@nprieto95
Copy link
Author

Let's celebrate the anniversary this July 26th

@kakone
Copy link

kakone commented Jul 1, 2020

Let's celebrate the anniversary this July 26th

We are getting closer

@jumpingjackson
Copy link

@alden-m
Copy link

alden-m commented Jul 9, 2020

Let's join, celebrate the anniversary, chit-chat, and get to know each other!

Alden Menz is inviting you to a scheduled Zoom meeting.

Topic: Celebrate ajax unobtrusive feature request anniversary
Time: Jul 25, 2020, 02:00 PM Eastern Time (US and Canada)

Join Zoom Meeting
https://us04web.zoom.us/j/74857196510?pwd=SmJoSWtJbjYrdlAwck5GamhDR1NFUT09

Meeting ID: 748 5719 6510
Password: 9PWJWg

@vanillajonathan
Copy link

@alden-m
Copy link

alden-m commented Jul 25, 2020

After five minutes it is :d let's join and have some fun

@Eilon
Copy link
Member

Eilon commented Jul 27, 2020

Tagging @Pilchie who is the current owner of this project. Unfortunately I don't work on this project anymore so I don't have much to add to this discussion.

@kakone
Copy link

kakone commented Sep 28, 2020

@Pilchie, after two years of waiting, can you take 2 seconds (no need more) to merge the pull request #36. Thanks in advance.

@kakone
Copy link

kakone commented Nov 4, 2020

Okay, Houston, we have a problem here !

@mkalinski93
Copy link

Just wanted to add that fixing this would be a big help for my team

I think you should update the line of code by yourself and not use the npm package anymore. You must just replace the line url: this.action by url: clickTarget && clickTarget.attr('formaction') || this.action.
Don't expect the pull request to be merged, we've been waiting for it a year and a half.

Thanks for the hint, I was heavily looking for it :D

@jumpingjackson
Copy link

@mkArtakMSFT, @javiercn, @ryanbrandenburg, @terrajobst ping!

I think its ridiculous that this simple 1 line of code fix cannot be be merged and published after 2+ years. Bueller?? Bueller?? Do we need to send some angry tweets?

@kakone
Copy link

kakone commented Jan 28, 2021

IMPORTANT: This repository is in maintenance mode. We do not work, nor plan to work on any new features. Only security and critical bug fixes will be worked on.

I think it's a stupid thing. This little library is essential when you develop in ASP.Net Core, and it doesn't cost much to include one PR per year.
I will have to offer another NPM package to support the formaction attribute 😟

@vanillajonathan
Copy link

IMPORTANT: This repository is in maintenance mode. We do not work, nor plan to work on any new features. Only security and critical bug fixes will be worked on.

I think it's a stupid thing. This little library is essential when you develop in ASP.Net Core, and it doesn't cost much to include one PR per year.
I will have to offer another NPM package to support the formaction attribute 😟

Yeah @mkArtakMSFT! 😡

@javiercn javiercn removed their assignment Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cost: S Will take up to 2 days to complete investigate PRI: 2 - Preferred Preferably should be handled during the milestone. question
Projects
None yet
Development

No branches or pull requests