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

How do I submit the form when a checkbox/radio has been clicked? #93

Open
shannont opened this issue Sep 14, 2014 · 1 comment
Open

Comments

@shannont
Copy link

Hi guys :)

I'm really stupid at jQuery ...but I got prettycheckable working! The only problem is I want to submit the form when someone clicks a checkbox or a radio button, without the need to click the submit button.

How do I achieve this?

I tried:

 <script type"text/javascript">
$(":checkbox").click(function() {
  $(this).closest("form").submit();
});
</script>

or

<script type"text/javascript">
$(":checkbox").on('change', function() {
  $(this).closest("form").submit();
});
</script>

But neither is working. What am I doing wrong?

@arthurgouveia
Copy link
Owner

How are you initialising the plugin?

Can you provide a working example? Maybe CodePen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants