Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to get checkbox value from html to client side in widget- Service Portal

Ajay Sharma2
Tera Guru

How to get checkbox value from html to client side in widget- Service Portal

1 ACCEPTED SOLUTION

Upender Kumar
Mega Sage

Test attached widget.

View solution in original post

5 REPLIES 5

Community Alums
Not applicable

Hi Ajay,

Try 

var checkBox = document.getElementById("enableButton").value

alert(checkBox);

 

Mark Correct & Helpful, if applicable.

Thanks,

Sandeep

Bachu Lakshmi G
Kilo Expert

Hi Ajay Sharma,

Please refer Below code Example for getting check box value from HTML into the client Script.

HTML Code 

<h1>Passig Values from HTML to CLient script</h1>

<input type="checkbox" id="myCheck1" value="Yes, I'm a web developer">



<button type="submit" ng-click="c.submit()" >Check</button>

Client Script


api.controller=function() {
/* widget controller */
var c = this;

c.submit=function () {
var yes = document.getElementById("myCheck1");

alert("hi Value is :"+yes.checked);
}

Please find Below Screenshots for your reference:

find_real_file.png

find_real_file.png

If it is helpful, Please mark helpful/correct.

Thanks.

Warm Regards,

Ganesh.

Upender Kumar
Mega Sage

@Ajay Sharma  Please close this thread.