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've moved the forum!

Please use for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

UserForms - loaded into other page

Go to End

4 Posts   1660 Views


Community Member, 267 Posts

1 November 2011 at 2:57am

Edited: 14/12/2011 11:26am


I have a reservation form which is on [removedMyUrl]
Everything is very nicely styled with css, also the custom errors are set.

Now i have a pageType 'Diensten' where I want to include this form at the bottom of the page.

So i use:

class Diensten_Controller extends Page_Controller {
   function ShowForm(){
		$get = DataObject::get_one('UserDefinedForm');
		return new UserDefinedForm_Controller($get); 

            <% control ShowForm %>
            <% end_control %>            


The form shows on all pages, BUT:
- the custom error messages are the default onces, not the onces i've set
- the styling of the error message is different

WHY? and HOW can i fix this?


Community Member, 267 Posts

14 December 2011 at 3:17am

UP! Still need a fix for this :(
The validation works more-or-less, but I get the default errors and the datePicker isnt working! The checkbox is required, but it isn't required when the form is loaded through showForm(); this is not my intention.

Any one? Willr?


Community Member, 271 Posts

14 December 2011 at 5:13am

you need to block the prototype validation and add the jquery javascript
see UserDefinedForm_Controller init:

// block prototype validation

// load the jquery
Requirements::javascript(SAPPHIRE_DIR .'/thirdparty/jquery/jquery.js');


Community Member, 267 Posts

14 December 2011 at 5:32am

works like a charm!! thank you so much!