Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to Display Multiple Checkboxes Horizontally on a Record Producer Form?

E555
Tera Guru

Hi everyone,

I’m working on a Record Producer form and would like to display three checkboxes horizontally (side-by-side) instead of vertically stacked.

Is there any recommended way to achieve this in ServiceNow?

1 ACCEPTED SOLUTION

Siddhesh Jadhav
Kilo Sage

Hi @E555,

You can refer to this: Solved: Arrange variables in a container in Service catalo... - ServiceNow Community
However, that approach allows you to arrange only two checkboxes horizontally.

 

If you need to display more than two checkboxes side-by-side, another option is to use a UI Page variable type and place your HTML inside the UI Page.
But keep in mind that if you use a UI Page, you will also need to write all the client-side scripts to handle the checkbox logic.
This adds extra complexity, so it’s usually not the preferred method.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

    <!-- Wrapper div for checkboxes -->
    <div class="checkbox-container">
        <label>
            <input type="checkbox" id="checkbox1"/> Option 1
        </label>
        <label>
            <input type="checkbox" id="checkbox2"/> Option 2
        </label>
        <label>
            <input type="checkbox" id="checkbox3"/> Option 3
        </label>
    </div>

</j:jelly>


Results:

SiddheshJadhav_0-1764331184164.png

 

Thanks & Regards,
Siddhesh Jadhav

If my solution helped to resolve your query, please mark it as Accepted and Helpful

 

View solution in original post

3 REPLIES 3

PoonkodiS
Giga Sage

Refer the KB article to create the variables horizontally using container

Siddhesh Jadhav
Kilo Sage

Hi @E555,

You can refer to this: Solved: Arrange variables in a container in Service catalo... - ServiceNow Community
However, that approach allows you to arrange only two checkboxes horizontally.

 

If you need to display more than two checkboxes side-by-side, another option is to use a UI Page variable type and place your HTML inside the UI Page.
But keep in mind that if you use a UI Page, you will also need to write all the client-side scripts to handle the checkbox logic.
This adds extra complexity, so it’s usually not the preferred method.

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

    <!-- Wrapper div for checkboxes -->
    <div class="checkbox-container">
        <label>
            <input type="checkbox" id="checkbox1"/> Option 1
        </label>
        <label>
            <input type="checkbox" id="checkbox2"/> Option 2
        </label>
        <label>
            <input type="checkbox" id="checkbox3"/> Option 3
        </label>
    </div>

</j:jelly>


Results:

SiddheshJadhav_0-1764331184164.png

 

Thanks & Regards,
Siddhesh Jadhav

If my solution helped to resolve your query, please mark it as Accepted and Helpful