Delays between JS avents


I have no experience with Javascript but have been trying to include a delay between events.

First i obtain an populate a field with an ip address then the form is automatically submitted.

The IP address is taking too long to populate so the form is submittig without the IP address value.

var ipInputID = 'fieldxxxxxxxxx';
TB.render('component_5', function(data) {
    $.get("", function(data) {
        $('#' + ipInputID)

Not sure how to include this.


@richardch372, no need to add a delay. Define the submit button and trigger the click in the API callback.

var ipInputID = 'fieldX';
TB.render('component_ID', function(data) {
        let formSubmit = $(data.ele.find('.form-submit button'));
        $.get( "", function( data ) {

Thank you @Chem

1 Like