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

Notifications

Announcements

No record found.

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,983 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
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 96

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 69 Super User 2025 Season 2

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 43 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans