Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request nette#131 from chemix/doc-2.2
Browse files Browse the repository at this point in the history
Forms: added - setEmptyValue
  • Loading branch information
dg committed Oct 14, 2014
2 parents 60b0aa1 + 48a98de commit d3d11cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cs/forms.texy
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,13 @@ $form->addCheckbox('agree', 'Agree with conditions')
->setDefaultValue(TRUE);
\--

Další užitečnou možností je použití "emptyValue". Pokud je hodnota prvku po odeslání formuláře shodná s nastavenou "emptyValue", tváří se prvek jako nevyplňený.

/--php
$form->addText('phone', 'Phone:')
->setEmptyValue('+42');
\--


Vzhled formulářů
================
Expand Down
8 changes: 8 additions & 0 deletions en/forms.texy
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,14 @@ $form['country']->setDefaultValue('sk'); // country defaults to Slovakia
\--


Another usefull option is the "emptyValue". If value of the form field after form submit is same as its "emptyValue" the field behaves as not filled.

/--php
$form->addText('phone', 'Phone:')
->setEmptyValue('+42');
\--


Form appearance
===============

Expand Down

0 comments on commit d3d11cf

Please sign in to comment.