Can I change how jForm generates HTML for the Form fields?

by GDP   Last Updated May 15, 2018 17:10 PM

Is there a way to manipulate the resulting HTML that jForm generates?

$this->form->renderField('myfield');

Apparent Joomla Default Form HTML

<div class="control-group">
    <div class="control-label">
        <label id="jform_myfield-lbl" for="jform_myfield" data-placement="bottom">My Field</label>
    </div>
    <div class="controls">
        <input name="jform[myfield]" id="jform_myfield" value="My Value" class="input-sm" placeholder="Enter a value" aria-invalid="false" type="text">
    </div>
</div>

Preferred HTML

<div class="form-group">
    <label for="myfield" class="col-sm-2 control-label">My Field</label>
    <div class="col-sm-10">
        <input class="form-control valid" id="myfield" name="myfield" value="My Value" placeholder="Enter a value" required="" type="text">
    </div>
</div>
Tags : jform


Related Questions


Set New XML attribute in custom JFormField

Updated April 21, 2015 21:04 PM



Store fields data in JSON

Updated May 18, 2015 21:04 PM

username from ID

Updated August 03, 2015 14:04 PM


Cache file /home/queryxchang/public_html/apps/frontend/config/../cache/-q-11-22832-can-i-change-how-jform-generates-html-for-the-form-fields- could not be written