Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Onchange event does not fire sometimes in Forms

Posted on by Microsoft Employee

Hi

I have some js functions in my forms, that fire when a field changes. But these functions does not work something. I even put a "deubbger" and used browser developer tools to see if the code reaches to the function, but it seems it does not call it at all.

Is there any reason for that ? I have spent lots of time with many browsers but have not got any solution. The wonderful thing is that it happens in Dynamics CRM 2015, and I have never seen it in 2011 Version.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Onchange event does not fire sometimes in Forms

    The browser versions are same. The interesting part is that validations works in CRM 2011 but have problem with CRM 2015.  

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Onchange event does not fire sometimes in Forms

    Hi Meharin

    It does not show any error. As I mentioned It works in my browser and some other customers browsers, but it does not work sometimes in a few customers browsers without any error.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Onchange event does not fire sometimes in Forms

    Please verify that your Customer browser settings and Version are same as your browser settings and Version

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Onchange event does not fire sometimes in Forms

    Hello babak ,

    Does it show you any error. If yes, please do share the code. If its not showing any error, then its most likely that you have misspelled the function name added. Make sure you have added the correct function name in the event handler tab within the Form Properties form (exactly the same function name as used within JS WebResource).

    Thank you :) 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Onchange event does not fire sometimes in Forms

    Hi

    Here is how I send parameters to tho function. I configure it in onchange event of the field properties windows in CRM form:

    fieldName="",checlen=11

    And here is the function :

    function digitValidateOnChange(context,fieldName,checlen,untilLenghthCheck)

    {

    var reg = /^-?\d*\.?\d+$/;

    //debugger;

    errorHelper(context,reg,fieldName,checlen,untilLenghthCheck);  

    }

    It works find in my browsers, but it does not work sometimes at customer browser. even When I put a debugger before "errorHelper" function it does not reach there.

  • Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Onchange event does not fire sometimes in Forms

    Hi,

    Can you please share your code?

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans