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

Any way to make buttons work automagically like an input type="submit" ? #27

Closed
treeder opened this Issue Nov 26, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@treeder

treeder commented Nov 26, 2014

For eg:

<paper-button raised>Submit</paper-button>

Be nice if that would just submit like a normal input submit.

@rnicholus

This comment has been minimized.

Owner

rnicholus commented Nov 26, 2014

You can either call the submit function on the form via JavaScript or perhaps include an input submit button as a child element of the paper button.

On Tue, Nov 25, 2014 at 6:26 PM, Travis Reeder notifications@github.com
wrote:

For eg:

<paper-button raised>Submit</paper-button>

Be nice if that would just submit like a normal input submit.

Reply to this email directly or view it on GitHub:
#27

@rnicholus

This comment has been minimized.

Owner

rnicholus commented Nov 26, 2014

Here's a very simple example that assumes the page has only one form:

<paper-button id="submitButton" raised>Submit</paper-button>
<script>
   document.getElementById('submitButton').addEventListener('click', function() {
      document.forms[0].submit(); 
   });
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment