Tuesday, August 26, 2014

Re: unidentified index

Hello Stephan,
Thank you this is helpful.  

On Tuesday, August 26, 2014 1:50:04 PM UTC-4, Dallas wrote:
In migrating from 1.2.5 to 2.5.3 I am getting undefined index for input of name, business name, phone and email.  I updated form as much as possible - but if I use DataHelper - I can no longer use array - is there a quick way to fix this using isset() or do i need to rewrite - here is the code: - Thank you
echo '<div class="highlight-box">';
    echo $this->Form->create(null, array('url' => $loc)); 
    echo $this->Form->hidden('adv_form', array('value' => 'adv_form'));
    echo $this->Form->input('name', array('type'=>'text', 'value'=>$this->data['name'], 'label'=>'', 'after'=>'Contact Name'));
    if(array_key_exists('name', $this->Errors)){echo $this->Errors['name'];}
    echo $this->Form->input('business_name', array('type'=>'text', 'value'=>$this->data['business_name'], 'label'=>'', 'after'=>'Business Name'));
    echo $this->Form->input('phone', array('type'=>'text', 'value'=>$this->data['phone'], 'label'=>'', 'after'=>'Phone Number'));
    if(array_key_exists('phone', $this->Errors)){echo $this->Errors['phone'];}
    echo $this->Form->input('email', array('type'=>'text', 'value'=>$this->data['email'], 'label'=>'', 'after'=>'e-mail'));
    if(array_key_exists('email', $this->Errors)){echo $this->Errors['email'];}
    echo $this->Form->submit('add.gif');
    echo $this->Form->end();
    
    if($msg != '')
    {
        echo '<br />';
        echo $msg;
        echo '<br />';
    }
echo '</div>';
?>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: