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.

Form Questions /

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

Checkboxsetfield and its name attribute


Go to End
Reply


95 Views

Avatar
tobedamobe

Community Member, 1 Post

17 August 2017 at 6:00pm

Edited: 17/08/2017 6:04pm

Hey folks,
first i wanna say HELLO to everyone. I am a silverstripe user for almost a year and a half and now i joined the cummunity because i need your help.

So lets go: i am using a checkboxfieldset for a frontend form. Additionally i am using the jquery validate plugin for this form. The plugin wants to have its rules in a form like this...

rules{
Fieldname:{
required:true,
minlength:1
}
}

My problem is that silverstripe generates the fieldset with name-attributes like so:

name=Fieldname[Value A]
or
name=Fieldname[Value B]
and These dont fit to the rules-syntax of the validate plugin. Which has to be
name=Fieldname[]

Either i am using the checkboxfield wrong or i missed to learn a basic html-form-pattern regarding array-name-attributes :D

I hope you can help me!! ;)