Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Can I change image source using custom javascript

(1) ShareShare
ReportReport
Posted on by 5

Good Afternoon,  I have been trying to modify the following code (originally used to hide or show an input filed based on dropdown selection),  I am trying to utilize this to change an image source based on the dropdown selection.

The code works great for a field, but I am trying to use it to change an image source.

I have been trying to utilize the getElementById function, but I do know know if this function will work inside of the custom JavaScript fields on my 'Portal Management".  I have been watching many hours of tutorials on basic JavaScript to make this work.  However, I do not know if all JavaScript works inside "portal management" .

Is there any documentation of what we can and cannot utilize within the "Custom Javascript" on the "portal management app"?

Any help would be appreciated - Thank you in advance.

Elizabeth S.

Code I am trying to modify:

$(document).ready(function () {

     $("#move_acctreq2").change(onDisplaySectionChange);

     onDisplaySectionChange();

});

 function onDisplaySectionChange() {

    var varManuf = $('#move_acctreq2').find("option:selected").text();

 

    if (varManuf === "Yes") {

    

       $('#move_test').parent().parent().show();

    }

    else {

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

    }

  • M.Anas Profile Picture
    M.Anas 35 on at
    RE: Can I change image source using custom javascript

    You can modify html and java script in custom java script section

    this link will help you.

    carldesouza.com/.../

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans