When I am counting the given subject mark, am getting onchange error

1997vinny
Tera Contributor

This is my client script code:

  If(newValue)
        {
        var t = parseInt(g_form.getValue('u_telugu'));
        var h = parseInt(g_form.getValue('u_hindi'));
        var e = parseInt(g_form.getValue('u_english'));
        var m = parseInt(g_form.getValue('u_maths'));
        var sc = parseInt(g_form.getValue('u_science'));
        var so = parseInt(g_form.getValue('u_social'));

        var tl = parseInt(t + h + e + m + sc + so);
        g_form.setValue('u_total', tl);
        }
 
Error: onChange script error: ReferenceError: If is not defined function () { [native code] }
 
I given all subject marks after given the social marks, going to total tab.
I am getting this error.
How to resolve this error?
0 REPLIES 0