I have this form with a date input.
echo $this->Form->create('Nodata');
echo $this->Form->input('date1', array('type' => 'date', 'label' => 'From:'));
echo $this->Form->input('date2', array('type' => 'date', 'label' => 'To:'));
echo $this->Form->end('Get Hours');
When the form is submitted, I’m showing the results in the same view, below the form.
My problem is I have a link that is not part of the form and need to read the value (in the view) from the date field on the form to use it as a param
on this link.
// date1 is the param I need to take the value from date input
<th> <?php echo $this->Html->link(__('Agents Detail'), array('controller' => 'qcas', 'action' => 'hours', 'paramProject' => $hour['Qca']['dir_id'], 'date1' => $this->data)); ?> </th>
Note this link is outside the form and I need a way to read a input on the form to use as param in my link.
Instead of just using
$this->datafor yourdate1element, you need to refer the field in the$this->dataobject.CakePHP < 2.0
CakePHP 2.0+
I’m not sure what you’re trying to do at the destination link, but you may need to format the date as well: