tags:

views:

175

answers:

1

Hi, I m using CakepHP and JQuery for my app.

In my code, there is a line like this which creates a Textbox of Label from Attribute table label column and With id from the table Attribute idcolumn ,class name as calendarSelectDate (to make use of Calendar of JQuery )and size too ..

Line 1

  echo $form->input($r['Attribute']['label'], array('id'=>$r['Attribute']['id'],'class'=>'calendarSelectDate','type'=>'text','style' => 'width:' . $r['Attribute']['size'] . 'px')); ?>

Line2

      <div id='calendarDiv'></div>

Line 1 will create the input text box in a Div of inputtext and now i am having a Div of calendarDiv which is created outside my inputtext Div..Label and text box are within inputtext . .How can i bring this calendarDiv inside my inputtext Div ... Please suggest me....

Please suggest me...

+1  A: 

Try using on of the 'before', 'between' or 'after' keys that can be sent to the FormHelp::input($fieldname, $options) $options array.

e.g.

echo $form->input($r['Attribute']['label'], array('id'=>$r['Attribute']['id'],'class'=>'calendarSelectDate','type'=>'text','style' => 'width:' . $r['Attribute']['size'] . 'px', 'after' => "<div id='calendarDiv'></div>"));
neilcrookes