| Author |
jQuery submit
|
Joe Stela
Greenhorn
Joined: Mar 22, 2012
Posts: 14
|
|
Hello,
I want to get the employee nos from selected checkbox,but I am getting it as null .
Below is my code.
I am selecting multiple employees from check box and then clicking on one button. The button has clickFunction() as below which is just submitting the form.
I am trying to submit the Form using jquery submit and employeeForm is the id of form field
function clickFunction(){
$('#employeeForm').submit();
}
After submit I am going to one jsp and trying to get the checkbox selected values in that jsp using request.getParameterValues("employeeList");
employeeList is name of my checkbox.
But I am getting null. Please let me know if I am missing something.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
|
Is the checkbox checked?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Joe Stela
Greenhorn
Joined: Mar 22, 2012
Posts: 14
|
|
|
yes , checkbox is checked.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
|
Use the browser's debugger to look at the request. It will show you whether the request parameter is encoded into the body (for a POST) or the URL (for a GET).
|
 |
Joe Stela
Greenhorn
Joined: Mar 22, 2012
Posts: 14
|
|
|
I am using firebug...but its not showing me anything related to this request, though its showing me data related to other requests.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
|
The debugger in Chrome and Safari has a Network tab that show all activity. I primarily use Chrome/Safari for developing these days as I think the debugger is better.
|
 |
Ashwini Kashyap
Ranch Hand
Joined: Aug 30, 2012
Posts: 61
|
|
Hi Joe,
Also make sure you are checking the checkbox in your function like:
$("#fieldID").attr("checked", "checked");
Thanks,
Ashwini Kashyap
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
Show you html markup.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56157
|
|
Ashwini Kashyap wrote:
Also make sure you are checking the checkbox in your function like:
$("#fieldID").attr("checked", "checked");
That does not do any checking -- it sets the element's checked attribute.
|
 |
 |
|
|
subject: jQuery submit
|
|
|