• Resolved hotcore

    (@hotcore)


    I’m new to Javascript but not to programming.

    When i use this snippet it works ok and field displays 180:
    (function(){
    var volw1 = 180;
    var volwx = 60;
    var kind = 50;
    var ret = volw1;
    return ret;
    })();

    But when added one line to display a date field the field doesn’t get calculated and is empty:
    (function(){
    var volw1 = 180;
    var volwx = 60;
    var kind = 50;
    var ret = volw1;
    windows.alert(fieldname30);
    return ret;
    })();

    Why?

    https://wordpress.org/plugins/calculated-fields-form/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi,

    Because in javascript the object is called ‘window’, in singular, the object ‘windows’ does not exists, so, your code provokes an error that is stopping the javascript execution.

    Best regards.

    Thread Starter hotcore

    (@hotcore)

    Hi,
    of course. My bad. Thx!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Javascript error??’ is closed to new replies.