Do while loop | WordPress.org

Hello @hheyhey568

The do/while loops in javascript have no problems by themselves. The problem is the way you use it. The browser evaluates the do/while loop while the condition is true.

Unfortunately, you do not include the equation. But assuming it uses two fields, fieldname1 and fieldname2, and you want to evaluate the loop only if the fields values are greater than or equal to zero. The equation structure would be similar to:

(function(){
    if(AND(0<=fieldname1, 0<=fieldname2)) {

        /* YOUR LOOP HERE */  

    } else {
         alert('The fields values are invalid');
    }
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer