function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
utotschkautotschka 

Override Save Button workaround?

Hello,
 
I have a problem with embedding javascript. I want to populate a few fields when the country on an account (or lead, ...) is entered. Along with that I want to enforce a specific format for the country.
 
I have the Javascript for that, my only problem is that it is not possible to override the save button.
Does anyone of you know a workaround to that problem? Is it possible to set an onChange Eventhandler for the country text field?
 
Thanks for your help!
utotschkautotschka

Hello unikevin,

Thanks for your reply.  I am not sure whether field dependencies are the right solution for my problem.

My Javascript (currently only working outside Salesforce) does the following:  

my user enters a countryname, like for example GERMANY or germany into the country text field. The Javascript corrects the writing so that the result is always Germany (capital first letter, the rest in small letters).

How can I embed my Javascript code into this form since it is not possible to override the save Button to include that check?

Thanks again for helping!

utotschka