1

I am trying to change the width of a <s:textfield> I created like this:

<s:textfield name="process.name" key="lbl.process.name" cssClass="col-sm-4"/>

but it turns out into:

<div class="form-group ">
   <label class="col-sm-3 control-label" for="ShowProcess_process_name" >
      Displayname        
   </label>    
   <div class="col-sm-9 controls">
      <input type="text" name="process.name" value="name" id="ShowProcess_process_name"class="form-control col-sm-4"/>
   </div>
</div>

but what I want is:

<div class="form-group ">
   <label class="col-sm-3 control-label" for="ShowProcess_process_name" >
      Displayname        
   </label>    
   <div class="col-sm-4 controls">
      <input type="text" name="process.name" value="name" id="ShowProcess_process_name"class="form-control"/>
   </div>
</div>

Does anyone know how to change the width via bootstrap?

Shog9
  • 156,901
  • 35
  • 231
  • 235
John
  • 142
  • 1
  • 11

1 Answers1

4

The cssClass is for styling input itself. To style the element which wraps input use elementCssClass attribute instead of cssClass.

<s:textfield name="process.name" key="lbl.process.name" elementCssClass="col-sm-4" />
Aleksandr M
  • 24,264
  • 12
  • 69
  • 143