picklist to picklist

Posted by clga29261 on 13-Jan-2016 19:35

Hi,

name of my to picklist, billing state and shipping state.

how to passed the value of one picklist(billing state) to another picklist(shipping state) in new page in new version of rollbase.


i create a button(anchor html tag) in template text field .when i click the link, the idea is, when the billing state picklist has a value, then click the anchor tagm then the value pass to shippin state.

thanks,

All Replies

Posted by jsniemi79 on 13-Jan-2016 21:02

I do something similar in one app.  I had to fire the change on the picklist to get the value to work appropriately.  Below is the the function I call on click the button.  Near the bottom you can see how I handled the picklist for the state.

$("#myButton").click(function() {

     myAddress1 = rbf_getFieldValue("streetAddr1");

  if (myAddress1 != '') {

      rbf_setFieldValue("billing_address1", myAddress1);

       }

      myAddress2 = rbf_getFieldValue("streetAddr2");

  if (myAddress2 != '') {

      rbf_setFieldValue("billing_address2", myAddress2);

        }

      myCity = rbf_getFieldValue("city");

  if (myCity != '') {

      rbf_setFieldValue("billing_city", myCity);

       }

       myCountry = rbf_getPicklistCode("country");

  if (myCountry != '') {

      rbf_setPicklistCode("billing_country", myCountry);

      }

      myState = rbf_getPicklistCode("state");

      myStateValue = $("#rbi_F_state option:selected").text();

      if (myState != '') {

      rbf_setPicklistCode("billing_state", myState);

         $("select[name='billing_state']").change();

       }

      myZIP = rbf_getFieldValue("zip");

  if (myZIP != '') {

      rbf_setFieldValue("billing_zip", myZIP);

       }

   });

This thread is closed