web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to get text field value in crm 2015 which is coming from Html webresource through javascript?

(0) ShareShare
ReportReport
Posted on by 125

 <input type="text" id="visDate" style="font: 15px Calibri; width:130px" onchange="return getSlot();">

i want to get this VisDate  text field value through  java script  which is coming from html web-resource i.e added in  case entity form.  

how to get it  please help me.

I have the same question (0)
  • Suggested answer
    Marco.P Profile Picture
    2,405 on at

    Hi, maybe as a workaround  you can try to save the field value on storage, and try to get It through your js form handler.

    Hope it helps,

    www.google.com/.../

    Hope it helps,

    Marco

  • Suggested answer
    Bipin D365 Profile Picture
    28,985 Moderator on at

    HI,

    You can easily get text value from html web resource javascript code using document.getElementById("VisDate  ").value and once you have the text value, you can use parent.Xrm.Page to update any field on case form.

    docs.microsoft.com/.../webpage-html-web-resources

    If found helpful, Please mark my answer verified.

  • NehaGupta Profile Picture
    125 on at

    Hi i am using this one but getting null in alert  of visit date. I need to get value of this text field.

    function Rollback(){

    var source = Xrm.Page.data.entity.attributes.get("statuscode")

    var information = source.getValue();

    var customHtml = Xrm.Page.ui.controls.get("WebResource_SlotAvailability");

    var destination = customHtml.getObject().contentWindow.document;

    if(destination) {

     var visitDate = destination.getElementById("vistime");

      alert(visitDate);

     if(customControl) {

       customControl.value = information;

      alert(customControl.value);

     }

    }

    }

  • Suggested answer
    saurabhtiwarii Profile Picture
    Microsoft Employee on at

    Hi,

    Document.getElementById() may require legacy form rendering.

    developer.mozilla.org/.../getElementById

    Please mark my comments as answered if this helps.

    Thanks,
    Saurabh

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 73 Super User 2026 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 69 Most Valuable Professional

#3
11manish Profile Picture

11manish 50

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans