File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Finding Value of Checkboxes by Name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Finding Value of Checkboxes by Name" Watch "Finding Value of Checkboxes by Name" New topic
Author

Finding Value of Checkboxes by Name

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1413
The following code shows every checkbox with same has a value of one even though it is not checked(should be value of 0)

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1413
I think I understand why the 'value' will not work because that is set when jsp is loaded.

What I need is to know from a set of checkboxes which ones are checked and which ones are not and this needs to be by name of set.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

You should be checking the checked property: $(this).prop("checked")

Steve Dyke wrote:I think I understand why the 'value' will not work because that is set when jsp is loaded.

Nothing to do with JSP; the value property is set from the HTML value attribute and is completely unaffected by any change in state of the checkbox.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Finding Value of Checkboxes by Name