<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412333#M1234468</link>
    <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#000000"&gt;Yes you are right my script works reliably in Classic/Native UI, but in Workspace it depends on how the field is rendered. For a fully Workspace safe solution using UI Builder properties or the Workspace compatible client script approach would be more reliable.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Oct 2025 12:06:28 GMT</pubDate>
    <dc:creator>Community Alums</dc:creator>
    <dc:date>2025-10-24T12:06:28Z</dc:date>
    <item>
      <title>Hi All, Want to make a date field readonly but it should allow calender to choose date in workspace</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412212#M1234450</link>
      <description>&lt;P&gt;Hi All, I Want to make a date field readonly or the input box hould be disabled but it should allow calender to choose date in workspace. I tried with ui policies and client scripts but the calender is also becoming readonly in workspace any approach or suggestion here plz?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 10:19:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412212#M1234450</guid>
      <dc:creator>Venkatesh098765</dc:creator>
      <dc:date>2025-10-24T10:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412220#M1234453</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; Requirement:&lt;BR /&gt;Make a date field read-only (no typing) but still allow using the calendar picker in ServiceNow Workspace.&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;BR /&gt;1) UI Builder Property (Best Option)&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;If you control the Workspace page via UI Builder:&lt;/P&gt;&lt;P&gt;1. Open **UI Builder** → your Workspace page → the Record Form or Data Broker component.&lt;BR /&gt;2. Select the date field.&lt;BR /&gt;3. In the Properties panel, set:&lt;BR /&gt;- Disable text input → true&lt;BR /&gt;- or Allow text input → false&lt;BR /&gt;- or Input mode → Picker only&lt;BR /&gt;4. Save and preview.&lt;/P&gt;&lt;P&gt;Users can still click the calendar icon but can’t type in the field.&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;BR /&gt;2) Client Script (Workspace-Safe)&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;If you can’t modify the UI Builder page, use an onLoad Client Script:&lt;/P&gt;&lt;P&gt;```javascript&lt;BR /&gt;function onLoad() {&lt;BR /&gt;var field = 'u_my_date'; // Replace with your field name&lt;/P&gt;&lt;P&gt;(function hook() {&lt;BR /&gt;var ctrl = g_form.getControl(field);&lt;BR /&gt;if (!ctrl) return setTimeout(hook, 200);&lt;/P&gt;&lt;P&gt;function findAndBlock() {&lt;BR /&gt;var input = ctrl.querySelector('input');&lt;BR /&gt;if (!input) return setTimeout(findAndBlock, 200);&lt;/P&gt;&lt;P&gt;input.addEventListener('keydown', e =&amp;gt; e.preventDefault(), true);&lt;BR /&gt;input.addEventListener('beforeinput', e =&amp;gt; e.preventDefault(), true);&lt;BR /&gt;input.addEventListener('paste', e =&amp;gt; e.preventDefault(), true);&lt;BR /&gt;input.style.caretColor = 'transparent';&lt;BR /&gt;}&lt;BR /&gt;findAndBlock();&lt;BR /&gt;})();&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;- Prevents typing or pasting.&lt;BR /&gt;- Still allows date selection via the calendar button.&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;BR /&gt;3) CSS Approach (Quick Alternative)&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;Add this CSS rule in your Workspace page or theme:&lt;/P&gt;&lt;P&gt;```css&lt;BR /&gt;[data-field="u_my_date"] input {&lt;BR /&gt;pointer-events: none;&lt;BR /&gt;caret-color: transparent;&lt;BR /&gt;}&lt;BR /&gt;[data-field="u_my_date"] button {&lt;BR /&gt;pointer-events: auto;&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;This disables typing in the text box but keeps the calendar button clickable.&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;BR /&gt;4) Optional: Map to Due Date&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;If the selected date must map to `due_date`, use:&lt;/P&gt;&lt;P&gt;```javascript&lt;BR /&gt;function onChange(control, oldValue, newValue, isLoading) {&lt;BR /&gt;if (isLoading) return;&lt;BR /&gt;g_form.setValue('due_date', newValue || '');&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;------------------------------------------------------------&lt;BR /&gt;Summary&lt;BR /&gt;------------------------------------------------------------&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; Best: Use “Disable text input / Picker only” in UI Builder.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; If unavailable: Use client script to block typing.&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; Quick fix: Use CSS to disable pointer events on text input only.&lt;/P&gt;&lt;P&gt;This ensures users can select dates via calendar but cannot manually type them.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 10:24:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412220#M1234453</guid>
      <dc:creator>MaxMixali</dc:creator>
      <dc:date>2025-10-24T10:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412234#M1234454</link>
      <description>&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#000000"&gt;In Workspace by making a date field readonly disables both the input and the calendar icon. Instead of readonly, use the readonly display type at runtime like this in a Client Script (onLoad) by doing this disables direct typing but still allows users to open the calendar picker and select a date.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#000000"&gt;Example -&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;g_form.setReadOnly('your_date_field', false);
g_form.getControl('your_date_field').readOnly = true;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 10:36:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412234#M1234454</guid>
      <dc:creator>lakshaysharma</dc:creator>
      <dc:date>2025-10-24T10:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412302#M1234459</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/483836"&gt;@Venkatesh098765&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it will be read-only, what purpose it serves to allow them to select calendar?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 11:44:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412302#M1234459</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-10-24T11:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412307#M1234461</link>
      <description>&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#000000"&gt;Here Venkatesh doesn’t want read-only data, he want to restrict input method.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 11:47:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412307#M1234461</guid>
      <dc:creator>lakshaysharma</dc:creator>
      <dc:date>2025-10-24T11:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412328#M1234465</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/998423"&gt;@lakshaysharma&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;got it.&lt;/P&gt;
&lt;P&gt;in that case your script will work in native UI but not sure if it works in Workspace&lt;/P&gt;
&lt;P&gt;Did you try that in workspace?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:01:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412328#M1234465</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-10-24T12:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412333#M1234468</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="trebuchet ms,geneva" color="#000000"&gt;Yes you are right my script works reliably in Classic/Native UI, but in Workspace it depends on how the field is rendered. For a fully Workspace safe solution using UI Builder properties or the Workspace compatible client script approach would be more reliable.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:06:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412333#M1234468</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-10-24T12:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412334#M1234469</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/5239"&gt;@Ankur&lt;/a&gt; Yes, you are right my script works reliably in Classic/Native UI, but in Workspace it depends on how the field is rendered. For a fully Workspace-safe solution, using UI Builder properties or the Workspace compatible client script approach would be more reliable.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:08:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412334#M1234469</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-10-24T12:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412337#M1234470</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Yes, you are right my script works reliably in Classic/Native UI, but in Workspace it depends on how the field is rendered.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:08:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412337#M1234470</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-10-24T12:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Hi All, Want to make a date field readonly but it should allow calender to choose date in worksp</title>
      <link>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412363#M1234477</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;Yes, you are right; my script works reliably in the Classic-Native UI, but in Workspace it depends on how the field is rendered.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2025 12:29:03 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/hi-all-want-to-make-a-date-field-readonly-but-it-should-allow/m-p/3412363#M1234477</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-10-24T12:29:03Z</dc:date>
    </item>
  </channel>
</rss>

