[Play] Iterate over objects using jQuery

What if I want to navigate into each checkbox, radio of my html? You can do it pretty easily using jQuery.each function.

In every checkbox element I want to send a post message to my Play Framework.

jQuery.each($(':checkbox'), function() {
    $.post('@{myPlayMethod()}', { itemValue: $(this).val() })
});

This code sends the html element value property to method “myPlayMethod(String itemValue)“.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • LinkedIn
  • MySpace
  • Twitter
This entry was posted in play and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>