Class to Input Field

itpates 23 Mar, 2018
Is there a way to add a class to the actual input field rather than just the containing div? I'm trying to get the Repeater Area to work, but all new fields completely ignore the original containing class and the javascript I've written toward that. I want each field to be able to have its own class.
Max_admin 25 Mar, 2018
Hi itpates,

Did you try the "Extra attributes" in the Advanced area of the field settings:
class:my_field_class
You may need to use {var:area_name.key}

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
itpates 26 Mar, 2018
Excellent. I can see the class applied to the additional fields via the Inspector. Now...how do I get javascript to actually recognize the added fields? I am using the following to test:
$(".allownumericwithdecimal").on("keyup", function(){
alert( "You typed something!!!" );
});
The original field works perfectly. Additional fields, however, totally ignore that, even though I can see class=allownumericwithdecimal in the input field. This {var:area+name.key} - does that have something to do with this functionality? If so where do I use it, and what do I replace "area_name" with?
Max_admin 30 Mar, 2018
Hi itpates,

You will need to edit your code:
$("body").on("keyup", ".field_class", function(){
alert( "You typed something!!!" );
});
Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.