Buy Now
Sign in

JavaScript code stop working (I guess)

nilubon03 , January 02 2020, 21:25
N
nilubon03 122
January 02 2020, 21:25 #390535
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 8
January 03 2020, 05:24 #390536
You can just use field events instead of trying to use code. There are demo forms that can show you what to do.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine!
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
GreyHead 64
January 03 2020, 10:16 #390538
Hi Nilubon,
Joomla no longer uses the MooTools JavaScript library, your JavaScript will need to be re-written using JQuery.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
N
nilubon03 122
January 07 2020, 20:06 #390583
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
Attachments
Screen_Shot_2020-01-07_at_2.59.39_PM.png
Screen_Shot_2020-01-07_at_2.59.39_PM.png
(65.82 KiB)
25 Downloads/Views
GreyHead 64
January 08 2020, 12:37 #390589
Hi nilubon03,
I have no idea - if you post or PM a link to the form we can take a quick look.
Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
N
nilubon03 122
January 08 2020, 15:24 #390592
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