Zjisteni existence chyb ve formulari
Upozornění: Tohle vlákno je hodně staré a informace nemusí být platné pro současné Nette.
- HonzsSedlomn
- Člen | 7
Ahoj, rad bych se zeptal jestli jde nejak v latte souboru zjistit jestli existuje naplneny inputError? :)
{form userInformationForm}
<div class="box-body">
{foreach $form['userInformationForm']->components as $component}
{/foreach}
<div class="form-group">
{label username}
{input username class => 'form-control'}
<div class="help-block">{inputError username}</div>
</div>
<div class="form-group">
{label first_name}
{input first_name class => 'form-control'}
<div class="help-block">{inputError first_name}</div>
</div>
<div class="form-group">
{label last_name}
{input last_name class => 'form-control'}
<div class="help-block">{inputError last_name}</div>
</div>
<div class="form-group">
{label email}
{input email class => 'form-control'}
<div class="help-block">{inputError email}</div>
</div>
<div class="form-group">
{label address}
{input address class => 'form-control'}
<div class="help-block">{inputError email}</div>
</div>
<div class="form-group">
{label profile_image}
{input profile_image class => 'form-control'}
<div class="help-block">{inputError profile_image}</div>
</div>
</div>
<div class="box-footer">
{input submit class => 'btn btn-primary'}
</div>
{/form}
Mam tento kod a potreboval bych kazdemu inputu, kde je error pridat css
class.
Nic me nenapada.
Diky moc za rady :)