Giter Club home page Giter Club logo

Comments (9)

steelbrain avatar steelbrain commented on July 17, 2024 1

IMO this issue belongs to paper-button, it should be extending the native button tag so that it would trigger both the native and the iron-form events, 'cause it should be possible to use paper-button with a regular form tag, in case you have a form with action of javascript: and are capturing the submit event and sending data through a websocket.

from paper-button.

steelbrain avatar steelbrain commented on July 17, 2024 1

@notwaldorf I am not sure if that would work, 'cause you can't submit a form until there's a button tag, I mean not at all.
so to workaround this behavior, we will not only have to trigger submit on the form on paper-button's click, but we will also have to stick an empty button element somewhere in the form.

from paper-button.

tjsavage avatar tjsavage commented on July 17, 2024

From @steelbrain on July 21, 2015 1:10

Maybe this can be solved by making paper-button extend the button tag?

from paper-button.

tjsavage avatar tjsavage commented on July 17, 2024

Hm... Seems to me like an issue with iron-form - will move there.

from paper-button.

tjsavage avatar tjsavage commented on July 17, 2024

Moving again, correctly this time.

from paper-button.

tjsavage avatar tjsavage commented on July 17, 2024

This issue was moved to PolymerElements/iron-form#32

from paper-button.

notwaldorf avatar notwaldorf commented on July 17, 2024

Unfortunately, since the paper-button needs to style some things, it cannot extend a native button (at the moment you can't extend a native element and change its template).

I think the simplest solution is in your code that uses the form, add an on-click listener for your paper-button, and call form.submit() (see example: https://github.com/PolymerElements/iron-form/blob/master/demo/index.html#L93)

@cdata: do you see a different way for the paper-button to figure out which form it should submit? :(

from paper-button.

notwaldorf avatar notwaldorf commented on July 17, 2024

@steelbrain I don't think that's correct. You can manually submit the iron-form without a native button. If you check out the iron-form demo (https://github.com/PolymerElements/iron-form/blob/master/demo/index.html#L54), removing the native button from any of the forms will not affect the actual form submission. (you can see that the data is printed out, and the request goes through)

from paper-button.

steelbrain avatar steelbrain commented on July 17, 2024

I was actually talking about the vanilla HTML form 😅

from paper-button.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.