Set checkbox is check by default in portal

tsoct
Tera Guru

Hello all,

 

I would like the checkbox is checked by default 

 <input type="checkbox" ng-disabled="requireWholeDay" ng-checked="isAllDay" id="isAllDayInput" ng-click="toggleAllDay($event)" />
                    <label for="isAllDayInput">${All day}</label>

I've tried the below but doesnt work, anything i've missed?

 <input type="checkbox" ng-disabled="requireWholeDay" ng-checked="isAllDay" id="isAllDayInput" ng-click="toggleAllDay($event)" checked="checked"/>
                    <label for="isAllDayInput">${All day}</label>

Thank you

 

1 ACCEPTED SOLUTION

Hello @tsoct 

 

I feel that your ng-checked is passing some value which is overriding on checked attribute.

 

can you remove the ng-checked and try plz once.

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

View solution in original post

6 REPLIES 6

Samaksh Wani
Giga Sage
Giga Sage

Hello @tsoct 

 

 

 <input type="checkbox" ng-disabled="requireWholeDay" ng-checked="isAllDay" id="isAllDayInput" ng-click="toggleAllDay($event)"  checked/>
                    <label for="isAllDayInput">${All day}</label>

 

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

Hello, 

Unfortunately not working too.

From the portal page inspect I see only. The checkbox added at the end is not showing when portal load

<input type="checkbox" ng-disabled="requireWholeDay" ng-checked="isAllDay" id="isAllDayInput" ng-click="toggleAllDay($event)" role="checkbox">

 

 

<input checked="true" type="checkbox" ng-disabled="requireWholeDay" ng-checked="isAllDay" id="isAllDayInput" ng-click="toggleAllDay($event)" role="checkbox">

 

add it at the start with value true.

Thanks @Samaksh Wani ,

Tried but still the same. not showing as checked.