Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Rego Form for a Calendar Event

Go to End

6 Posts   1330 Views


Community Member, 79 Posts

3 November 2009 at 6:11pm

Hi All,

I have searched through the forum for an example of a registration form for a calendar event, but I haven't found any. I almost have things working, except one little sticking point.

Okay I have extended the CalendarEvent to create a Workshop. At the bottom of the page I want a registration form. I can get the form to display without problem with the following code.

When I submit the form I get this error

Fatal error: Class 'Fieldset' not found in /Library/WebServer/Documents/lighthouseresources/httpdocs/mysite/code/Workshop.php on line 35

Any suggestions why this would happen. If I replace the $fields variable with $fields = singleton('Member')->getCMSFields(); it submits fine (although I don't want to use the member class just using it to try and work out what is going on...

class Workshop_Controller extends CalendarEvent_Controller {

	function Form() {
		$fields = new Fieldset (
			new TextField('Course', 'Course', $this->Title),
			new DateField('CourseDate', 'Course Date'),
			new TextField('YourName', 'Your Name'),
			new TextField('Organisation', 'Organisation'),
			new TextField('PostalAddress', 'Postal Address'),
			new TextField('Suburb', 'Suburb'),
			new TextField('Postcode', 'Postcode'),
			new TextField('City', 'City'),
			new EmailField('Email', 'Email'),
			new TextField('PhoneBusinessHours', 'Phone (Business Hours)'),
			new TextField('PhoneMobile', 'Mobile Phone'),
			new TextareaField('SpecialRequirements', 'Dietary or Special Requirements'),
			new CompositeField(new OptionsetField('Payment', 'Payment', array("InvoiceMe" => "Invoice Me", "InvoiceMyOrganisation" => "Invoice My Organisation"))),
			new CompositeField(new CheckboxField('ReadTermsAndConditions', "I have read and accept the conditions outlined in the <a href=\"/cancellation-policy/\" title=\"Cancellation Policy\">Our Cancellation Policy</a>"))
		$actions = new FieldSet(
			new FormAction('doSubmitJob', 'Submit')
		$validator = new RequiredFields(
		$form = new Form(
		return $form;
	function doSubmitJob($data, $form) {
		// Do something here like send an email
		//Set data
		$From = "";
		$To = "";
		$Subject = "Workshop Registration";
		$email = new Email($From, $To, $Subject);
		//set template
		//populate template
		//send mail
		//return to submitted message
         'Form successfully submitted',


Community Member, 79 Posts

4 November 2009 at 5:26pm

Anyone willing/able to help. I imagine this is something that a thousand people have done before me and isn't that difficult. I am either go about it the wrong way or am just calling a wrong function or something.

Any help would really be appreciated.



Community Member, 323 Posts

4 November 2009 at 9:12pm

Hi Colin,

Try writing FieldSet correctly on that second line: it reads Fieldset.

Hope it helps,


Community Member, 79 Posts

4 November 2009 at 9:46pm

Firstly sorry for being a retard and secondly thanks for solving the problem.

Quick question. That particular method is used to generate the form in the first place and it doesn't fail then. It only failed in the second instance on submission? Seems a bit strange or am I AGAIN missing something very simple.

Thanks again,


Community Member, 323 Posts

4 November 2009 at 10:20pm

You’re not alone in Retardland: I asked myself the same question about a form being correctly shown despite the error in spelling, then failing on submission. The trace of the error should explain it.


Community Member, 79 Posts

4 November 2009 at 10:22pm

Thanks again for the help. I will definitely take another look at the error trace and see what is going on.