frankwong61
Forum Replies Created
-
Hi Nithin,
Disabling “Load form using AJAX” worked but only for the first options page.
Best regards.
Hi John,
I’ve removed the additional statements when I first tested the mu-plugin code that you’ve shared, and it didn’t work, hence the additional statements I’ve added to try to narrow down the cause.
Anyways, here’s the link to the test site: https://testsite.inhsystem.com/wwf/self-assessment/
Best regards
Hi Laura,
Here is the form as exported:
and the mu-plugin (I added some console.log statements in an attempt to figure out if the script was even doing anything)
I’ll continue poking around with my form to see if I can figure something out in the mean time.
Thanks
Hi Adam,
I have tested the code that you’ve sent, and it does not appear to work.
The code has been copied into /wp-content/mu-plugins folder as formiantor-radio-styling.php, and the code has been edited:
On line 9: The element ID is “radio-1” and is thus left unchanged.
#radio-1 .radio-selected
The same for lines 21 and 22:
$('#radio-1 .forminator-radio input').on('change', function(){ $('#radio-1 .forminator-radio input').parent().removeClass('radio-selected');
On line 20: the number was changed to ’30’, the form ID as seen in the shortcode, as well as in the inspector.
if ( e.target.id == 'forminator-module-30' ) { //Please change the form ID
Upon disabling the cache and reloading of the page, and additional <style> and <script> segments can be seen on the inspector. However, no change was seen when the options are clicked. Manually adding the class “radio-selected” to the label containing the input does trigger the rule.
(Edited to clarify “cache is disabled”)
- This reply was modified 1 year, 6 months ago by frankwong61. Reason: Clarification/correction on disabling the cache
Hi Adam,
If it may be of any help, I have looked into the possibility of selecting the parent of an element, as is the relationship between the two classes involved if I’m not mistaken.
A response found on a different forum notes that there is a :has() pseudoclass in the works, but it is not supported by Firefox (of all the browsers, the one I am using), and for this effect to be achieved for all browsers, I’d have to incorporate JavaScript into the page, somehow.
Unfortunately, I am unfamiliar with the suitable ways of embedding a piece of custom JavaScript in the form. I don’t suppose I could write it into a HTML field, could I?
Best regards