10379 Posts in 2194 Topics by 1710 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 293 Views |
-
UserForms - loaded into other page

1 November 2011 at 2:57am Last edited: 14 December 2011 11:26am
Hello,
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:
Diensten.phpclass Diensten_Controller extends Page_Controller {
function ShowForm(){
$get = DataObject::get_one('UserDefinedForm');
return new UserDefinedForm_Controller($get);
}}
Diensten.ss
<% control ShowForm %>
$Form
<% end_control %>See
[removedMyURL]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 differentWHY? and HOW can i fix this?
-
Re: UserForms - loaded into other page

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?
-
Re: UserForms - loaded into other page

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
Validator::set_javascript_validation_handler('none');
// load the jquery
Requirements::javascript(SAPPHIRE_DIR .'/thirdparty/jquery/jquery.js');
Requirements::javascript('userforms/thirdparty/jquery-validate/jquery.validate.min.js'); -
Re: UserForms - loaded into other page

14 December 2011 at 5:32am
works like a charm!! thank you so much!
| 293 Views | ||
|
Page:
1
|
Go to Top |

