Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Show/hide date field

Posted on by

Hi All,

I have a need to show/hide fields on a web page in Dynamics 365 portals.

I have added custom JavaScript to the Web Page that successfully hides all fields as desired.  However, the date picker control remains visible.  When the code runs to show the fields, the date fields shows the date picker control and a text field.  Examples below:

Fields Hidden

FieldsHidden.jpg

Fields Show

FieldsShown.jpg

Is there a trick to hiding the date field?

Thank you!

*This post is locked for comments

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Show/hide date field

    Hi Tom,

    A datepicker control includes many elements.

    So if you want to hide a datepicker, you need to 

    • Destroy the datepicker functionality from the input text field.
    • Hide the input text field.

    Here is the demo:

    http://jsfiddle.net/ezKwN/

    Hope it helps.

    Best Regards

    Leo

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Show/hide date field

    Hi,

    Try parent .hide:

    $('#lac_datefield').parent().hide();

    Hope this helps.

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    Dmytro Rutkovskyi 1,835 on at
    RE: Show/hide date field

    I advice using next code snipping for hiding fields

    $("#new_datefield").closest("td").hide();



  • Tom Thompson Profile Picture
    Tom Thompson on at
    RE: Show/hide date field

    This is on the Portal Web Page, so it is my understanding that Business Rules do not apply.

    Code is..

    $('#lac_datefield').hide();

    $('#lac_datefield_label').hide();

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Show/hide date field

    Can you please share your code. Did you tried with busines rules?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans