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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Portal Best Practice for updating fields that are hidden or do not exist on a form using javascript when submitting

(0) ShareShare
ReportReport
Posted on by 1,532

Hi,

I would like to know what is the best practice for updating hidden fields or fields that do not exist on a form when clicking the submit button.

I have several fields that need to be updated when a user clicks the submit button.

For example:

Field1 contains the Last Name

Field2 contains the First Name

Field3 is the hidden field that will bind  Field1 and Field2 together to make the Full Name

Field3  = Field1 + " " + Field2

Thanks

I have the same question (0)
  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Since the fields are hidden from the form, we could not use JS to get and update them.

    1.Trigger workflows to update the hidden fields from portal.

    dysfunctionalconsultant.com/.../

    2.Trigger plug-in from portal.

    www.thrives.be/.../

    Regards,

    Leo

  • rthompson Profile Picture
    1,532 on at

    Hi Leo,

    So use power automate would be the best approach when using to update on the Submit button portal?

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    As we know, the data displayed on the portal and web side is synchronized, so that using workflow to update hidden fields directly in D365 or using Flows to update hidden fields are all a good way.

    Regards,

    Leo

  • Suggested answer
    rthompson Profile Picture
    1,532 on at

    Hi,

    I figure out away to update a field using javascript.

    Here's what I did. First I added the field that I wanted to update onto my CRM form. I tried hiding the field in CRM but that will not work.  So, I has to make the field visible.

    Once I did that I added the following code. This did the job. I used on change event's to update the field before Submitting.

    The field that I needed to update is "new_name". I used javascript to hide the "new_name" on the form.

    $(document).ready(function() {
    
       //Hide the name field
       $("#new_name").hide();
       $("#new_name_label").hide();
    
       $("#new_speedname").change(function() {
         fullDescription();
       });
    
       $("#new_amountunit").change(function() {
          fullDescription();
       });
    
    });
    
    
    //Add the full description for the new_name field
    function fullDescription() {
    
       var speedDesc = $("#new_speedname").val();
       var amountUnit = $("#new_amountunit").val();       
       var fullDesc = speedDesc   ", "   amountUnit;
    
       $("#new_name").val(fullDesc);
    };

  • Suggested answer
    CRMJetty Profile Picture
    3,512 on at

    Hi Dear,

    Greetings of the day!

    In regards to your concern, please try the below steps on your end:

    Step 1: Add Fullname field in portal form.
    Step 2: OnLoad of form, hide this field.
    Step 3: On Click of submit assign first name + last name field value to fullname field.

    Kindly try the above things on your end and let us know in case of any other concerns, I would be happy to assist you further for the same

    Kind Regards,

    CRMjetty

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

    DynamicsCRM Customer Portal for Wordpress

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 > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Pallavi Phade Profile Picture

Pallavi Phade 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans