Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Unable to trigger a script in html webresource

(0) ShareShare
ReportReport
Posted on by 2,665
Hi,

I am working on a html web resource which has a dropdown in it. On change of the dropdown value, I am trying to trigger a script but nothing happens. I did try to debug but script won't trigger in the first place. I have downloaded the latest jquery.

Is this the right way of doing so? Thanks for any suggestions.

<html><head>
<script src="new_jquery_1.9.1_latest.js" type="text/javascript"></script> 
     <script type="text/javascript"> 
         $(document).ready(function () { 
             $("#Onlyoption").change(function () { 
                 debugger; 
alert("triggered");
                            }); 
         }); 
             </script> 
<meta charset="utf-8"></head>

<body>
&nbsp; <font color="#444444" face="Segoe UI" size="2" font="">&nbsp;Time In:</font>   
<select id="Onlyoption"> 
         <option value="0000">xxxx</option> 
 <option value="0000">yyyy</option> 
 <option value="0000">zzzz</option> 
             </select></body></html>


*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,089 on at
    RE: Unable to trigger a script in html webresource

    Hello Roxanna,

    Is there any reason you are doing this using JQuery. Seems you can do it in simple way  like below . Hope this helps.

    <html>
    <head>
        <script src="new_jquery_1.9.1_latest.js" type="text/javascript"></script>
        <script type="text/javascript">
    
    //         $(document).ready(function () {
    //             $("#Onlyoption").change(function () {
    //                 debugger;
    //alert("triggered");
    //                            });
            //         });
    
            function callfunction()
            {
                alert("triggered");
    
            }
        </script>
        <meta charset="utf-8">
    </head>
    
    <body>
        &nbsp; <font color="#444444" face="Segoe UI" size="2" font="">&nbsp;Time In:</font>
        <select id="Onlyoption" onchange="callfunction();">
            <option value="0000">xxxx</option>
            <option value="0000">yyyy</option>
            <option value="0000">zzzz</option>
        </select>
    </body>
    </html>
  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: Unable to trigger a script in html webresource

    I am working on a html web resource. It is not a out of the box field. Thanks.

  • sai123456 Profile Picture
    sai123456 320 on at
    RE: Unable to trigger a script in html webresource

    2335.Capture5.JPGIf you are working on MSCRM every field has onchange option in form editor. you can assign a function to specific field onchange.

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans