Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Error on onchange Event

Questions related to using nuBuilder Forte.
oli
Posts: 118
Joined: Sat Mar 20, 2021 3:22 pm
Has thanked: 4 times

Error on onchange Event

Unread post by oli »

Hi,

I need to change the value of a select field dependent of the value of another select field.
I have the field "auf_ang_status". If this field is going to be changed to "cancelled" I want to change the value in the select field "auf_status" to "cancelled" as well.
Therefore I created an onchange Event on the Costum Code (field: auf_ang_status) with following content:

Code: Select all

if($(this).val() == 'cancelled'){
    $('#auf_status').val($(this).val()).change();    
    alert('Your Order will be cancelled!');
}
1st step is working: The value in field #2 will be also changed to "cancelled" but the alert box is not visible and I got following error in my console:

Code: Select all

jquery.js?ts=20210527154022:2 Uncaught RangeError: Maximum call stack size exceeded
    at S.fn.init.val (jquery.js?ts=20210527154022:2)
    at nuFormObject.calc (nuformclass.js?ts=20210527154022:591)
    at nuTotal (nuform.js?ts=20210527154022:3915)
    at eval (eval at <anonymous> (nuform.js?ts=20210527154022:3454), <anonymous>:1:9)
    at HTMLInputElement.<anonymous> (nuform.js?ts=20210527154022:3454)
    at Function.each (jquery.js?ts=20210527154022:2)
    at S.fn.init.each (jquery.js?ts=20210527154022:2)
    at nuCalculateForm (nuform.js?ts=20210527154022:3445)
    at nuChange (nuform.js?ts=20210527154022:3352)
    at HTMLSelectElement.onchange (index.php?i=0&opener=16221300228331002:1)
Any ideas what I am doing wrong here?

Thanks and br,
Oli
Post Reply