Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Change default value attribute of soy checkbox

Yurii Bilash July 7, 2017

I'm using

aui.form.checkboxField

and I need add value="true"(to override default value 'on') attribute to generated after soy proccessing input. And I don't know how to do it in soy. Can you help me?

When I tried to use 'extraAttributes' params to add 'value=true' to input I've got next html:

<fieldset class="group">
   <legend><span>Don't track anonymous</span></legend>
   <div class="checkbox" value="true"><input id="notTrackAnonymousUsers" class="checkbox" type="checkbox" name="notTrackAnonymousUsers" checked="checked"><label for="notTrackAnonymousUsers">Enabled</label></div>
   <div class="field-group">
      <div class="description">Don't track anonymous users.</div>
   </div>
</fieldset>

As you can see from html it added value="true" to div not to input. Maybe you know some work around?
My soy looks like follow:

{call aui.form.checkboxField}
                        {param legendContent: getText('ch.bitvoodoo.confluence.plugins.viewtracker.ViewtrackerSettingsConfigureAction.action.track.anonymous-users') /}
                        {param value: true/}
                        {param fields: [
                                            [
                                                'id': 'notTrackAnonymousUsers',
                                                'labelText': getText('ch.bitvoodoo.confluence.plugins.viewtracker.ViewtrackerSettingsConfigureAction.action.track.anonymous-users.label-text'),
                                                'isChecked': $notTrackAnonymousUsers,
                                                'name': 'notTrackAnonymousUsers'
                                            ]
                                        ]
                        /}
                        {param descriptionText: getText('ch.bitvoodoo.confluence.plugins.viewtracker.ViewtrackerSettingsConfigureAction.action.track.anonymous-users.desc') /}
                    {/call}

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events