BLOG • DIGITAL INSIGHTS
A quick hack for Sitefinity form rules - when multiple fields share the same title in a multipage form, run a one-liner in the browser console to append control IDs to field names and uniquely identify the correct field.
When using Sitefinity rules for forms, fields are shown with their title (label). This becomes problematic if you have multipage forms where multiple steps have fields with the same title - you can't tell which field is the correct one to target with a rule.
The fastest fix - until there is a proper improvement to the form rules screen - is to open your browser's Developer Tools (F12) and run the following code in the console:
$("option").each(function(){
$(this).text($(this).text() + " " + $(this).val());
});
After running this, the fields in the form rules dropdown will display something like: Country C55 - where C55 is the control ID. It's still a little cryptic, but it will at least allow you to uniquely identify each control.
To find out which "Country" field corresponds to C55 in the example above - go back to the form, inspect the field in the browser's developer tools, and look for the controlkey attribute. If it matches the ID you saw in the rules dropdown, that's your field.
Explore more insights and case studies from our team.