Same as billing address?

Posted by Rollbase User on 12-Nov-2009 20:53

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?

All Replies

Posted by Admin on 12-Nov-2009 21:06

You can implement "onclick" event handler for your check box. Follow Field Edit > Events. That page contains document which will lead your further.

Posted by Admin on 12-Nov-2009 21:29

what's the simple formula structure for that event?

Posted by Admin on 12-Nov-2009 21:42

Try example on Page 3 - its very close to what you're looking for.

Posted by Admin on 13-Nov-2009 20:06

The documentation referred to in the solution here is:
Rollbase Event Handlers and AJAX API: Reference and Examples

Posted by Admin on 15-Nov-2009 15:31

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.

Posted by Admin on 17-Nov-2009 19:32

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.

Posted by Admin on 18-Nov-2009 19:45

No longer a dependent picklist - not needed. Everything looks right, but not transferring over.

Posted by Admin on 23-Nov-2009 15:12

We'll take a look and get back to you directly on this.

Posted by Admin on 28-Nov-2009 14:18

any updates?

Posted by Admin on 02-Dec-2009 08:35

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

Posted by Admin on 02-Dec-2009 13:48

lead objection >> Lead record

Posted by Admin on 02-Dec-2009 15:33

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.

Posted by Admin on 02-Dec-2009 15:43

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.

Posted by Admin on 02-Dec-2009 16:04

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.

Posted by Admin on 15-Apr-2010 13:01

Hi.. sorry to reply to an old question..
but Pavel, could you please enlighten me as to the contents of the function cust_copyState() I am very interested in copying the contents of one field value (on the page) to another, before submit.

Thanks! :)

This thread is closed