Training - Custom Values Updater

Advanced - Pull in custom values from location and display in your form.


Advanced - Pull in custom values from location and display in your form.

Pull In Custom Values From The Location And Display In The Form

Copy the code below to pull in custom values from your other locations.

You'll need to make sure you have your custom value / fields mapping done in order for this to work. You can pull in custom values from

1) your current location, or

2) From a different location you pass to the page via url parameter "location" IE: https://mypage.com/form?location=1923120312 this lcoation can be hard coded like above or passed in a custom menu link by putting ?location={{location.id}} in the url. IE: https://mypage.com/form?location={{location.id}}.

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script><script src="https://api.ghlsmartscripts.com/js/SCRIPTS_Functions.js"></script><script>
    const newQS = window.location.search;  
 	var SMART_location = "{{ location.id }}";
  	var locid = "";
  
    if(newQS){
    	const urlParams = new URLSearchParams(newQS);
    	locid = urlParams.get('location');
  	}
  
  	if(locid != ""){
    	SMART_location = locid; 
    }
  
    $.getScript( "https://api.ghlsmartscripts.com/js/SmartCV-JS.php?location="+SMART_location, function( data, textStatus, jqxhr ) {
    console.log( "Load was performed." );

    if(textStatus == "success"){

    }
  });
  
</script>