Get value from unchecked checkbox in play

zogota

New Member
I need to get the value for an unchecked checkbox using the Play framework. I can get the value if I check the checkbox.My html is as follows\[code\] <input type="checkbox" name="correctAnswer" value="http://stackoverflow.com/questions/15734441/true">\[/code\]This is how I get the data in the controller, which gives me an array of only checked boxes\[code\] String[] segaMega = request().body().asFormUrlEncoded().get("correctAnswer");\[/code\]I have tried doing the hidden field before the checkbox trick, but that didnt work very well. Does play have anything that can help me?
 
Back
Top