Hi.
I need to call a custom js-function when user select a value of radio button. I tried to declare a function in an external file, and also just describe it in the "JS Code" field of "Load JavaScript" action, but it is not called. What i'm doing wrong?
Joomla! 3.6.2, Chronoforms v5.
I need to call a custom js-function when user select a value of radio button. I tried to declare a function in an external file, and also just describe it in the "JS Code" field of "Load JavaScript" action, but it is not called. What i'm doing wrong?
Joomla! 3.6.2, Chronoforms v5.
Hi alitvin ,
I can't tell from the information here. How are you trying to call it in the Load JavaScript action.
Bob
I can't tell from the information here. How are you trying to call it in the Load JavaScript action.
Bob
I'm trying to bind the event of a choice of a particular variant of the radio button[attachment=107867_20170311111216_bind-event-jpg.jpg]
[/attachment]
Js-file, in which the function is declared, is loaded through Load JavaScript
[/attachment]
Js-file, in which the function is declared, is loaded through Load JavaScript
Hi alitvin,
That looks OK to me. Please post a link to the form so I can take a quick look.
Bob
That looks OK to me. Please post a link to the form so I can take a quick look.
Bob
Hi Bob,
Link to the form. Function defined in consultant.js and it should be called when the last option is selected.
Thank for your help.
Link to the form. Function defined in consultant.js and it should be called when the last option is selected.
Thank for your help.
Hi alitvin,
Your event code appears to be linked to an input with the name 'c_outdoor_what - but I don't see that name anywhere in the form?
Bob
Your event code appears to be linked to an input with the name 'c_outdoor_what - but I don't see that name anywhere in the form?
Bob
I'm sorry, I probably can not understand. You do not have the item 'c_outdoor_what' on that page?
I understood. I have a multi-page form and on a direct link the "Event switcher" gives another form. Correct path to form: go to the link, click the "СТАРТ" button, select the first option "СНАРУЖИ". Sorry for incorrect information.
I understood. I have a multi-page form and on a direct link the "Event switcher" gives another form. Correct path to form: go to the link, click the "СТАРТ" button, select the first option "СНАРУЖИ". Sorry for incorrect information.
Hi alitvin,
Found it thank you. The event code to call the askQuestion function is running OK as far as I can see but the askQuestion function is not being run.
It may be because you now have two copies of the function - one in the consultant.js file and the other in the form itself. I suggest that you remove one of these and see if it them works correctly.
Bob
Found it thank you. The event code to call the askQuestion function is running OK as far as I can see but the askQuestion function is not being run.
It may be because you now have two copies of the function - one in the consultant.js file and the other in the form itself. I suggest that you remove one of these and see if it them works correctly.
Bob
Hi Bob
I remove the one copy of the function, but it is still not called 😟
It looks like a problem in the function call code:
And it should be:
This is a bug?
I remove the one copy of the function, but it is still not called 😟
It looks like a problem in the function call code:
if($("[name='c_outdoor_what']:checked").val() == "question"){
askQuestion;
}
And it should be:
if($("[name='c_outdoor_what']:checked").val() == "question"){
askQuestion();
}
This is a bug?
Hi alitvin,
Yes that's correct - if you add the () to the function name on the element Events tab then it works OK.
I'm guessing that something must have changed as I don't recall seeing this problem before :-(
Bob
Yes that's correct - if you add the () to the function name on the element Events tab then it works OK.
I'm guessing that something must have changed as I don't recall seeing this problem before :-(
Bob
This topic is locked and no more replies can be posted.