PDA

View Full Version : Need Required field indicator to the right side of the fields



kdipika
4 Jun 2013, 2:58 PM
Hi,

Currently in our application we have various form elements which are marked as required fields with asterik(*) in this way

{
xtype: 'textfield',
fieldLabel: 'Name<span class="ext_form_mandatory">*</span> ',
name: 'costName',
labelWidth: 120,
allowBlank: false
}

But the new requirement needs the (*) on the right side of the textfield.I know we can use composite field for this but I need a simple solution as this needs to be changed for every form element throughout the application.We are using ext-4.1.3

Please help.

slemmon
5 Jun 2013, 9:32 PM
Without messing with the base field tpl you might do something like:


afterSubTpl: '<div class="my-required" style="position:absolute;top:0;right:-18px;">*</div>'