I am trying to have billing address populate in the shipping address if its same. does apex has anything native that does this for you? or should I search for jquery Auto populate functions?

  • You could do it via the controller but quicker and easier to just use jQuery – Eric Sep 25 '15 at 22:44
  • alright, Ill search and see if I can find jquery , thank you @Eric – Metawaa Sep 25 '15 at 22:45
  • Depending on your requirement, you could also use a workflow to do this if a box is checked. – smckitrick Sep 26 '15 at 3:24

As Eric said you can do it easily with jQuery as below. This example assumes that you have a checkbox to let users allow autofill. Hope this will be a good starting point.

<script type="text/javascript">
            var state = $('#state-field option:selected').val();
            $('#state-field1 option[value=' + state + ']').attr('selected','selected');
        } else { 
            //Clear on uncheck
            $('#state-field1 option[value=Nothing]').attr('selected','selected');


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.