Same as billing address? - Forum - Rollbase - Progress Community

Same as billing address?

 Forum

Same as billing address?

  • Looking to do a simple "same as billing address" checkbox, where one set of fields would automatically update to another set when a checkbox is clicked. What is the best way to do that?
  • You can implement "onclick" event handler for your check box. Follow Field Edit > Events. That page contains document which will lead your further.
  • what's the simple formula structure for that event?
  • Try example on Page 3 - its very close to what you're looking for.
  • The documentation referred to in the solution here is:
    Rollbase Event Handlers and AJAX API: Reference and Examples
  • if (form.job_address_1 && form.job_address_1.value=='') form.job_address_1.value=streetAddr1.value; form.job_address_2.value=streetAddr2.value; form.job_city.value=city.value; form.job_zip_code.value=zip.value; form.job_state.value=form.current_state.value;

    does the code to copy a picklist value like job state to current state change since it's a picklist? Everything is working fine except that.
  • Can you make sure you copy the Country value before the State value because it is a dependent picklist. If this doesn't apply let us know. Yes picklists are handled a bit differently.
  • No longer a dependent picklist - not needed. Everything looks right, but not transferring over.
  • We'll take a look and get back to you directly on this.
  • any updates?
  • Nate,

    Can you let us know where you have this enabled? (what object and page) I could not find in these fields in your Job view or edit pages.

    Thanks,
    Matt
  • lead objection >> Lead record
  • You cannot simply use VALUE property since values are different for two SLECT components. I've implemented custom JavaScript function cust_copyState() to do the job.
  • Pavel, I see what you did. The only problem now is that when you change the "current address", the job address doesn't update, even when you uncheck and recheck the box. This is an odd behavior.
  • The way its done now any update may only happen when check box is checked (since that's where HTML handler lives). If you want to peg two controls you need to create HTML handlers for source controls (state, address etc) too.