Hi,
Here's an alternative approach using JavaScript to mark the required inputs. It's not ideal but doesn't require changes to the core code. Ad this script to a Load JS action in the On Load event of the form:[code]window.addEvent('domready', function() {
var required, cl, inputs, input, label, type, name, skip, marker ;
marker = ' *';
inputs = $$('div input, div select, div textarea');
required = [];
inputs.each(function(el) {
cl = el.getProperty('class');
if ( cl !== null && ( cl.contains("validate['required'") || cl.contains("validate['group[") ) ) {
required.push(el);
}
});
required.each( function(el){
el.addClass('cf_required');
skip = false;
type = el.getProperty('type');
if ( type == 'radio' || type == 'checkbox' ) {
if ( name != el.getProperty('name') ) {
label = el.getParent().getParent().getFirst('label');
name = el.getProperty('name');
} else {
skip = true;
}
} else {
label = el.getParent().getFirst('label');
}
if ( !skip ) {
label.appendText(marker);
label.addClass('cf_required');
}
});
});[/code]
It does two things: adds a marker - defined on the third line - to each label; and a class 'cf_required' to the labels and inputs so that you can use CSS to style them as a marker.
Not exhaustively tested so let me know what bugs you find. It seems to work on the standard ChronoForms layout but is dependent on the HTML structure to find the labels and may not work with all layout variants.
The image below is using this CSS
label.cf_required {
color: red;
}
input.cf_required, select.cf_required, textarea.cf_required {
border-left: 6px solid red;
}
Bob