Jump to:

2012 Posts in 1438 Topics by 621 members

Form Questions

SilverStripe Forums » Form Questions » trouble reading results of checkboxfield and checkboxsetfield.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 601 Views
  • vancouverWill
    Community Member
    121 Posts

    trouble reading results of checkboxfield and checkboxsetfield. Link to this post

    trouble reading results of checkboxfield and checkboxsetfield. I'm having an issue with checkboxfield where I can't extract the results from it in the controller and specifically in the form action function. I've used SS a lot over the last couple of years and made lots of forms where using the saveinto function can save all the data at once. Also on templates it easy to call the form variables by using its name and if part of array calling it by parentname.name . However I want to know what it is inside the action function so that I can decide how to finish the function but I can't get it to work. Either I get an index not recognized function or I get nothing at all. I thought this was a basic thing until today and can't see a way to figure it out anywhere.

    any ideas?



    edit: so i've been rechecking the code and I can access the checkbox every time if it is checked but if not checked everything crashes. I'm thinking of either writing some code to see if the checkbox name is included in the returned form array or looking for a thrown Exception. both should work but seems like there must be a quicker way to get this otherwise the SS form engine is just creating more work. not that I don't love SS so no hard feelings ;->

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.