ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

JavaScript code stop working (I guess)

nilubon03 02 Jan, 2020
Hello,
I have CFV4 since I built my Joomla 2.5 site. Now I am on Joomla 3.9.13 and CFV4 4.07. I plan to use Chronoforms 6 with my brand new Joomla 4 site, so I keep it the way it is for now.

I have form fields that hide on public view but available for admin to change value of that form fields on admin form. Below is a piece of code on Events tab > Load JS

window.addEvent('domready', function() {
$('active_subscription1_container_div').setStyle('display', 'none');
$('subscriptionname1_container_div').setStyle('display', 'none');

});

I also have a piece of code to gray out some form fields if one of the radio buttons is clicked.

I just noticed that two fields that set to hide is displaying and when I click the radio button, nothing gray out.

When I test form (both Test form and Frontend view) in the admin area, the hiding and disabling are working properly.

Attached is what I see on console.

Please advise.

Thank you,

N



Screen_Shot_2020-01-02_at_3.47.21_PM.png
healyhatman 03 Jan, 2020
You can just use field events instead of trying to use code. There are demo forms that can show you what to do.
GreyHead 03 Jan, 2020
Hi Nilubon,

Joomla no longer uses the MooTools JavaScript library, your JavaScript will need to be re-written using JQuery.

Bob
nilubon03 07 Jan, 2020
Hi GreyHead,

Thank you for your message.

While I was trying to re-write javaScript using jQuery, I removed all my JavaScript on the Events tab > LoadJS and saved the form to see the behavior, I am still getting the error. Please see below.
Is that mean the errors came from something else? Please point me out.
Thank you,
N

Screen_Shot_2020-01-07_at_2.59.39_PM.png
GreyHead 08 Jan, 2020
Hi nilubon03,

I have no idea - if you post or PM a link to the form we can take a quick look.

Bob
nilubon03 08 Jan, 2020
Hi Bob,

I just found out that the two versions of jQuery on my site are conflicting. Once I removed the jQuery newer version, the form is working properly.

Thanks for your time as always.

N
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com