0
$(document).on('carbonFields.apiLoaded', function(e, api) {
    // Get the current value in the 'crb_text' field
    var value = api.getFieldValue( 'crb_text' );
    console.log(value);
});

As mentioned in the doc https://carbonfields.net/docs/advanced-topics-javascript-api/ I tried the following code but it does not work. The apiLoaded event is not triggering. Any idea why?

jQuery is loaded. I do not get any errors. But it is not working either.

Rehan Adil
  • 47
  • 4
  • Maybe your code is running before CarbonFields is loaded? Hard to say with only that much code you shared. Try creating a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and share it with us so we can try it out. – cabrerahector Mar 26 '21 at 16:44
  • @cabrerahector my code is running in the footer and in the doc, that is all they mention. I saw some people having the same issues as me. – Rehan Adil Mar 26 '21 at 16:59

0 Answers0