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:

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Uncle Cheese? extending RequiredFields ConfirmedPasswordField issue

Go to End

2 Posts   1019 Views


Community Member, 22 Posts

28 November 2011 at 11:31pm

Edited: 04/12/2011 10:14pm

Hi all,

Uncle Cheese! are you there? I'm using allot of code snippits from the Postale module as I really like all the ajax calls etc etc, great job!.

Anyway I've successfully extended RequiredFields so I can use jQuery.form.js (lol... I think that's why). It is adding the xtra classes to the #Password div a-ok but that about all it does... the jQuery doesn't seem to append the required message label. The labels append fine on all the other required fields just not the confirmedPassword. Any help would be great! I'll buy you a beer! :)

Code below:


class CompanyMemberValidator extends RequiredFields
protected static $jquery_included = false;

protected static $field2class = array (
'ConfirmedPasswordField' => 'password',
etc etc etc....

protected static function get_class_for($fieldClass)
return self::$field2class[$fieldClass];
return false;

public static function jquery_included()
self::$jquery_included = true;

public function includeJavascriptValidation()

if($this->required) {
$fields = $this->form->Fields();
foreach($this->required as $name) {
$field = $fields->dataFieldByName($name);
if($class = self::get_class_for($field->class))
$form = $this->form->FormName();

public function javascript() {return; }



Forum Moderator, 1899 Posts

28 November 2011 at 11:59pm

Edited: 04/12/2011 10:14pm

Hi nimesodelta (and others),

Mainly I am moving things from "General questions" because often they are not about getting started with SilverStripe and they do fit elsewhere on the forum and as well as keeping spammers out I'd like to keep the information better organised in these forums.

Also if you want to label you post for the attention of Uncle Cheese I'd recomened doing it in his section of the forum - but it is a little limiting as if you write your question in a good way you may find someone else can and will answer.

I'll give you the choice of either UC's DOM section or All other modules... which would you like this to be moved to?