- Posts: 8
- Thank you received: 0
jquery not working on some forms
6 years 3 months ago #321044
by coquin
jquery not working on some forms was created by coquin
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.2.27
-- Browser(s) name and version -- : Chrome 83.0.4103.106 (Official Build) (64-bit)
Hello
using Joomla 3.9.19 and Hikashop Starter 4.3.0
I need to add pieces of jquery to address forms (e.g. in order to change background-color of firstname inputbox when focused), but sometimes - e.g.when openining the form via Usercontrol panel - it seems not to be possible, nothing happens.
Does it depend on something concerning ajax? Is there a way to bypass the problem?
Thank you very much
Ruggero
-- Joomla version -- : 3.9.19
-- PHP version -- : 7.2.27
-- Browser(s) name and version -- : Chrome 83.0.4103.106 (Official Build) (64-bit)
Hello
using Joomla 3.9.19 and Hikashop Starter 4.3.0
I need to add pieces of jquery to address forms (e.g. in order to change background-color of firstname inputbox when focused), but sometimes - e.g.when openining the form via Usercontrol panel - it seems not to be possible, nothing happens.
Does it depend on something concerning ajax? Is there a way to bypass the problem?
Thank you very much
Ruggero
Please Log in or Create an account to join the conversation.
6 years 3 months ago #321081
by nicolas
Replied by nicolas on topic jquery not working on some forms
Hi,
That's probably because if you add your javascript code to the form view file it is not being processed when the interface is being loaded in AJAX. I suppose because you have your code wrapped in jquery.ready ( learn.jquery.com/using-jquery-core/document-ready/ ) which isn't called when the JS is run after the AJAX.
If you edit the file address / listing.php via the menu Display>Views, you'll see many times the line:
In each places, you can call your own code after the interface is being refreshed in AJAX.
That's probably because if you add your javascript code to the form view file it is not being processed when the interface is being loaded in AJAX. I suppose because you have your code wrapped in jquery.ready ( learn.jquery.com/using-jquery-core/document-ready/ ) which isn't called when the JS is run after the AJAX.
If you edit the file address / listing.php via the menu Display>Views, you'll see many times the line:
Code:
t.loading(false);
Please Log in or Create an account to join the conversation.
6 years 3 months ago #321103
by coquin
Replied by coquin on topic jquery not working on some forms
Thank you for your prompt reply, Nicolas.
I took a look to listing.php and sow, but sorry I'm not so handy with ajax: would you give me a little example? Something like a js alert when clicking on firstname textbox or something similar?
Thanks so much
I took a look to listing.php and sow, but sorry I'm not so handy with ajax: would you give me a little example? Something like a js alert when clicking on firstname textbox or something similar?
Thanks so much
Please Log in or Create an account to join the conversation.
6 years 3 months ago #321104
by coquin
Replied by coquin on topic jquery not working on some forms
I mean also: where have I to put the code?
Please Log in or Create an account to join the conversation.
6 years 3 months ago #321135
by nicolas
Replied by nicolas on topic jquery not working on some forms
Hi,
Just put alert('test1'); and alert('test 2'); etc after each t.loading(false); and you'll see see where you need to add your javascript code based on which alert is displayed when you're on the area with the issue you have.
Just put alert('test1'); and alert('test 2'); etc after each t.loading(false); and you'll see see where you need to add your javascript code based on which alert is displayed when you're on the area with the issue you have.
Please Log in or Create an account to join the conversation.
6 years 3 months ago #321167
by coquin
Replied by coquin on topic jquery not working on some forms
Got it! Thank you Nicolas, I'm very grateful.
ruggero
ruggero
Please Log in or Create an account to join the conversation.
Time to create page: 0.252 seconds