CC-2412:Error causes box to float

- fixed
This commit is contained in:
james 2011-06-27 14:37:31 -04:00
parent 5f9dd83c38
commit 6a7f1d3588
2 changed files with 63 additions and 60 deletions

View File

@ -5,64 +5,71 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
public function init() public function init()
{ {
//$this->setDisableLoadDefaultDecorators(true);
//$this->removeDecorator('DtDdWrapper');
// Add start date element // Add start date element
$this->addElement('text', 'add_show_start_date', array( $startDate = new Zend_Form_Element_Text('add_show_start_date');
'label' => 'Date/Time Start:', $startDate->class = 'input_text';
'class' => 'input_text', $startDate->setRequired(true)
'required' => true, ->setLabel('Date/Time Start:')
'value' => date("Y-m-d"), ->setValue(date("Y-m-d"))
'filters' => array('StringTrim'), ->setFilters(array('StringTrim'))
'validators' => array( ->setValidators(array(
'NotEmpty', 'NotEmpty',
array('date', false, array('YYYY-MM-DD')) array('date', false, array('YYYY-MM-DD'))))
) ->setDecorators(array(
)); array(array('open'=>'HtmlTag'), array('tag' => 'dd', 'openOnly'=>true)),
'ViewHelper',
'Description',
array('Label', array('tag' =>'dt'))));
$this->addElement($startDate);
// Add start time element // Add start time element
$startTime = $this->addElement('text', 'add_show_start_time', array( $startTime = new Zend_Form_Element_Text('add_show_start_time');
'decorators' => array('ViewHelper', array('HtmlTag', array('tag'=>'dd'))), $startTime->class = 'input_text';
'class' => 'input_text', $startTime->setRequired(true)
'required' => true, ->setValue('00:00')
'value' => '00:00', ->setFilters(array('StringTrim'))
'filters' => array('StringTrim'), ->setValidators(array(
'validators' => array(
'NotEmpty', 'NotEmpty',
array('date', false, array('HH:mm')), array('date', false, array('HH:mm')),
array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))))
) ->setDecorators(array(
)); 'ViewHelper',
'Errors',
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
$this->addElement($startTime);
// Add end date element // Add end date element
$this->addElement('text', 'add_show_end_date_no_repeat', array( $endDate = new Zend_Form_Element_Text('add_show_end_date_no_repeat');
'label' => 'Date/Time End:', $endDate->class = 'input_text';
'class' => 'input_text', $endDate->setRequired(true)
'required' => true, ->setLabel('Date/Time End:')
'value' => date("Y-m-d"), ->setValue(date("Y-m-d"))
'filters' => array('StringTrim'), ->setFilters(array('StringTrim'))
'validators' => array( ->setValidators(array(
'NotEmpty', 'NotEmpty',
array('date', false, array('YYYY-MM-DD')) array('date', false, array('YYYY-MM-DD'))))
) ->setDecorators(array(
)); array(array('open'=>'HtmlTag'), array('tag' => 'dd', 'openOnly'=>true)),
'ViewHelper',
'Description',
array('Label', array('tag' =>'dt'))));
$this->addElement($endDate);
// Add end time element // Add end time element
$this->addElement('text', 'add_show_end_time', array( $endTime = new Zend_Form_Element_Text('add_show_end_time');
'decorators' => array('ViewHelper', array('HtmlTag', array('tag'=>'dd'))), $endTime->class = 'input_text';
'class' => 'input_text', $endTime->setRequired(true)
'required' => true, ->setValue('01:00')
'value' => '01:00', ->setFilters(array('StringTrim'))
'filters' => array('StringTrim'), ->setValidators(array(
'validators' => array(
'NotEmpty', 'NotEmpty',
array('date', false, array('HH:mm')), array('date', false, array('HH:mm')),
array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')) array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered'))))
) ->setDecorators(array(
'ViewHelper',
)); 'Errors',
array(array('close'=>'HtmlTag'), array('tag' => 'dd', 'closeOnly'=>true))));
$this->addElement($endTime);
// Add duration element // Add duration element
$this->addElement('text', 'add_show_duration', array( $this->addElement('text', 'add_show_duration', array(
@ -93,7 +100,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
if ((($formData['add_show_id'] != -1) && $startDateModified) || ($formData['add_show_id'] == -1)){ if ((($formData['add_show_id'] != -1) && $startDateModified) || ($formData['add_show_id'] == -1)){
if($start_epoch < $now_epoch) { if($start_epoch < $now_epoch) {
$this->getElement('add_show_start_date')->setErrors(array('Cannot create show in the past')); $this->getElement('add_show_start_time')->setErrors(array('Cannot create show in the past'));
$valid = false; $valid = false;
} }
} }

View File

@ -112,13 +112,9 @@ label.wrapp-label input[type="checkbox"] {
overflow: auto; overflow: auto;
} }
#add_show_start_time { #add_show_start_time, #add_show_end_time {
float: left;
width: 70px;
}
#add_show_end_time {
width: 70px; width: 70px;
margin-left:10px;
} }
#add_show_end_date_no_repeat, #add_show_start_date { #add_show_end_date_no_repeat, #add_show_start_date {