Note that there are some explanatory texts on larger screens.

plurals
  1. POThe Errors messages in edit actions, doesn't appear
    primarykey
    data
    text
    <p>I have my validation rules in model, and everything is fine. It validates like I want to, but in the Edit actions, although it not validates, don't show me de red error marks under textbox. </p> <p>Any tip?</p> <p>Thanks. </p> <p>The Model Code(Model name is Safpercent):</p> <pre><code>var $validate = array( 'sequencia' =&gt; array( 'must_be_numeric' =&gt; array( 'rule' =&gt; 'Numeric', 'message' =&gt; 'Number Field: insert only numbers.' ) ), ); </code></pre> <p>View Text Box:</p> <pre><code>echo $form-&gt;input('Safpercent.sequence', array('id' =&gt; 'sequence', 'options' =&gt; $criteria, 'label' =&gt; false, 'div' =&gt; false, 'style' =&gt; 'width: 300px')); </code></pre> <p>Controller Code:</p> <pre><code>function edit($id = null) { $criteria = $this-&gt;Safpercent-&gt;Safrequirement-&gt;find('list', array('fields' =&gt; array('Safrequirement.sequencia', 'Safrequirement.descricao'), 'conditions' =&gt; array('Safrequirement.tipo' =&gt; 'ILC'))); $this-&gt;set('criteria', $criteria); if (!$id &amp;&amp; empty($this-&gt;data)) { $this-&gt;Session-&gt;setFlash(RecordNotValid, 'flash_failure'); $this-&gt;redirect(array('controller' =&gt; 'safpercents', 'action'=&gt;'index')); } if (!empty($this-&gt;data)) { $sequencia = $this-&gt;data['Safpercent']['sequencia']; if($this-&gt;data['Safpercent']['tipo'] == ''){$tipo = 'ILC';}else{$tipo = $this-&gt;data['Safpercent']['tipo'];} $encontro = $this-&gt;Safpercent-&gt;Safrequirement-&gt;find('all', array('conditions' =&gt; array('sequencia' =&gt; $sequencia, 'tipo' =&gt; $tipo))); if($encontro &lt;&gt; array()){ if ($this-&gt;Safpercent-&gt;save($this-&gt;data)) { $this-&gt;Session-&gt;setFlash(RecordSaved, 'flash_success'); $this-&gt;redirect(array('controller' =&gt; 'safpercents', 'action'=&gt;'index')); }else{ $this-&gt;Session-&gt;setFlash(RecordNotSaved, 'flash_failure'); } }else{ $this-&gt;Session-&gt;setFlash('A Sequência que tentou Inserir não existe. Verifique a tabela de novo, por favor.'); } } if (empty($this-&gt;data)) { $this-&gt;data = $this-&gt;Safpercent-&gt;read(null, $id); $this-&gt;set('id', $id); } $this-&gt;set('cod_percent',$this-&gt;Safpercent-&gt;read(null, $id)); } </code></pre> <p>(Portuguese Variables and Text in some cases)</p>
    singulars
    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