Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jQuery submit

 
Joe Stela
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the checkbox checked?
 
Joe Stela
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes , checkbox is checked.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Show you html markup.

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic