Note that there are some explanatory texts on larger screens.

plurals
  1. POsymfony 1.4 validation form bind problem
    primarykey
    data
    text
    <p>I have some problem with validation forms in symfony 1.4 Here is code:</p> <pre><code>class NormalForm extends sfForm { public function configure() { $this-&gt;setWidgets(array( 'name' =&gt; new sfWidgetFormInput(), 'phone' =&gt; new sfWidgetFormInput(), 'terms' =&gt; new sfWidgetFormInputCheckbox(array('value_attribute_value' =&gt; 1, 'default' =&gt; true)) )); $this-&gt;widgetSchema-&gt;setNameFormat('results[%s]'); $this-&gt;setValidators(array( 'name' =&gt; new sfValidatorString(array('required' =&gt; true), array('required' =&gt; 'This field may not by empty')), 'phone' =&gt; new sfValidatorNumber(array('min' =&gt; 100000000), array('required' =&gt; 'This field may not by empty','min' =&gt; 'To short','invalid' =&gt; 'Not a number')), 'terms' =&gt; new sfValidatorBoolean(array('required' =&gt; true), array('required' =&gt; 'Accept the regulations')) )); } } class homeActions extends sfActions { public function executeIndex(sfWebRequest $request) { $this-&gt;nform = new NormalForm(); $this-&gt;module_action = "/".$this-&gt;moduleName."/".$this-&gt;actionName; $this-&gt;name = $request-&gt;getPostParameter('results[name]'); $this-&gt;phone = $request-&gt;getPostParameter('results[phone]'); $this-&gt;foo = $request-&gt;getPostParameter('results'); if($request-&gt;isMethod('post')){ $this-&gt;message .= 'post '; $this-&gt;nform-&gt;bind($request-&gt;getParameter('results')); if($this-&gt;nform-&gt;isValid()){ $this-&gt;message .= 'is valid'; $this-&gt;save = 'save'; } } } } </code></pre> <p>This is here: <a href="http://nowa.hipotekaplus.pl" rel="nofollow">http://nowa.hipotekaplus.pl</a></p> <p>When form is valid then should this text show:</p> <pre><code>&lt;h1&gt;Zgłoszenie zarejestrowano 1&lt;/h1&gt; &lt;p&gt;Dziękujemy za przesłanie zgłoszenia. Twój osobisty doradca na telefon z pewnością zadzwoni w ciągu 24 godzin (w dni robocze). Zgłoszenia obsługują doradcy kredytowi na telefon Hipotekaplus.pl.&lt;/p&gt; </code></pre> <p>Can somebody tell me why this not work ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload