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 :
Microsoft Dynamics CRM (Archived)

CRM 365 dynamically pass control to function using javascript.

(0) ShareShare
ReportReport
Posted on by 6

Hello All Experts,

It's irrelevant but still needed.

I have html web resource which contain two button .

one button for save and one for cancel.

on save button click i need to call a JavaScript function.

function will contain parameters , but i want to pass the whole control as parameter to submit function.

can anyone help me in resolving this.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Emre GULCAN Profile Picture
    2,379 on at

    Hi,

    If your function like this;

    function myFunctionWithParameters(firstname, lastname) {
       alert("Hello " + firstname + " " + lastname);
    }
    


    you can use / call this function on button click like this 

    <input type="submit" onclick="myFunctionWithParameters('Emre', 'GULCAN')" value="Save" />

    Of course you can pass a control as parameter, however your function must has a parameter for this control and after passing you can use your control inside your function

  • EmployeeOcta Profile Picture
    6 on at

    Hello Emre,

    Thanks for your response,

    can you provide me sample code to pass controls in place of hardcoded text.

    actually that only my requirement.

    suppose i have text , checkbox, textarea, select controls which i want to pass to the function.

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans