Use the SHtml.checkbox to generate your checkboxes: From the ExploringLift book:
The checkbox method generates a checkbox form element, taking an initial Boolean value as well as a function ( Boolean) => Any that is called when the checkbox is submitted. If you've done a lot of HTML form processing you might wonder how this actually occurs, since an unchecked checkbox is not actually submitted as part of a form. Lift works around this by adding a hidden form element for each checkbox with the same element name, but with a false value, to ensure that the callback function is always called. -- John Goodsen RADSoft / Better Software Faster jgood...@radsoft.com Lean/Agile/XP/Scrum Coaching and Training http://www.radsoft.com Ruby/Rails, Scala/Lift and Java Solutions On Thu, Dec 3, 2009 at 4:33 PM, edgarchan <edgarchancarri...@gmail.com>wrote: > Hi > > i tried the json form tutorial (HowTo_use_JSON_forms) and everything > was ok until i put some checkboxes ... the thing is that no matter how > many of them i check only one is being send to the server. > > example > > <lift:JSONForm.show> > <input type="text" name="name" /> > <br /> > <input type="text" name="value" /> > <br /> > <input type="radio" name="vehicle" value="Bike" /> > <input type="radio" name="vehicle" value="Car" /> > <input type="radio" name="vehicle" value="Airplane" /> > <br /> > <select name="cars"> > <option value="volvo">Volvo</option> > <option value="saab">Saab</option> > <option value="opel">Opel</option> > <option value="audi">Audi</option> > </select> > <br /> > Soccer: <input type="checkbox" name="sports" > value="soccer" / > ><br /> > Football: <input type="checkbox" > name="sports" value="football" / > ><br /> > Baseball: <input type="checkbox" > name="sports" value="baseball" / > ><br /> > Basketball: <input type="checkbox" > name="sports" > value="basketball" /> > <button type="submit">Submit</button> > </lift:JSONForm.show> > > > > apparently it has to do with the way the formToJSON function creates > the object > im using 1.1-snapshot > > -- > > You received this message because you are subscribed to the Google Groups > "Lift" group. > To post to this group, send email to lift...@googlegroups.com. > To unsubscribe from this group, send email to > liftweb+unsubscr...@googlegroups.com<liftweb%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/liftweb?hl=en. > > > -- John Goodsen RADSoft / Better Software Faster jgood...@radsoft.com Lean/Agile/XP/Scrum Coaching and Training http://www.radsoft.com Ruby on Rails and Java Solutions -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.