• Post Reply Bookmark Topic Watch Topic
  • New Topic

doget/doPost  RSS feed

 
kan nat
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the method called, when the user clicks a check box option, is it doget or dopost.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing wil happen. If you submit the parent form afterwards, it depends on the request method specified in the form.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just clicking on a checkbox causes no submit. Why did you think that it did?
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would only happen if you added some Javascript code to the onclick which causes a form to submit to the server side. In this case the answer still stands: it depends on the request method as specified in the form element.
 
ryan sukale
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kan,

As everyone has already mentioned, if you have a checkbox and you click on it, a doGet or a doPost is not fired.

Assuming that your checkbox is on a form and you have not mentioned POST or GET values for the form's method attribute, the by default you use a GET.
doGet or doPost are called based upon the method attribute of the form tag, and is independent of what happens when you click a checkbox.

Of course javacsript can be added to the checkbox to make things a bit more interesting!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!