Accordion With Forms

I have a two panel accordion. Both panels render partial forms. The first panel’s form page works, but the second does not. If I reverse the order the new first form page works. So it is definitely the second page that is not working.

I have tried many combinations, but none work.

Here is my accordion widget:




<?php 

	$this->widget('zii.widgets.jui.CJuiAccordion',array(

    'panels'=>array(	

		'Individual Contributor'=>$this->renderPartial('_partial_indiv_contrib',

			array('job_profile'=>$job_profile),true),	

			

		'Leading Sales People'=>$this->renderPartial('_partial_leading_sales_people',

			array('job_profile'=>$job_profile,),true),

    ),

    // additional javascript options for the accordion plugin

    'options'=>array(

    	'active'=>true,

    	'atuotHeight'=>false,

        //'animated'=>'bounceslide',

    	'alwaysOpen'=>false,

    	'collapsible'=>true,

    ),

));

?>


Here is one of the form pages:


<div class="form">


<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'job-opening-form',

	'enableAjaxValidation'=>false,

)); ?>

	<?php echo $form->checkBox($job_profile,'indiv_contr_or_leader', array('checkedValue'=>2, 'checked'=>'checked', 'uncheckValue'=>0)); ?>

		<td>I am an individual contributor</td>

<br><br>

<b>My work involves</b> (Check All that Apply):


<table><tr><td>	<?php echo $form->checkBox($job_profile,'bus_dev', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Actively pursuing creative solutions to identify gaps or problems of potential new clients, not selling from a book of products. Also M&A Deal & Capital Transactions.</td></table>

<table><tr><td>	<?php echo $form->checkBox($job_profile,'inside_sales', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Activily meeting with clients to close deals in person on a regular basis.</td></table>

<table><tr><td>		<?php echo $form->checkBox($job_profile,'outside_sales', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>In an office, placing outbound calls, closing sales on a regular basis over the phone or Web-EX.</td></table>	

<table><tr><td>		<?php echo $form->checkBox($job_profile,'channels', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Selling to someone who will resell their products, not directly closing deals with the end user. Could be through a distribution channel.</td></table>

<table><tr><td>		<?php echo $form->checkBox($job_profile,'acct_mgrs', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Over 50 percent of time is spent with existing customers to close deals.</td></table>

		

<?php $this->endWidget(); ?>

</div>



Is there anyone out there using forms within an accordion panel display? I sure hope so!

What doesn’t work?

Do the forms have unique id’s?

Thank you for your help!

The second panel’s fields do not show up in the $_POST[‘JobProfile’]. If I switch the order of the panel’s (in the accordion widget, then they show up as the first panel and the new second panel field’s are gone.

The form id’s were the same. I made them all unique, but same results. I’m not real knowledgable about the form id’s as I haven’t turned on or understood AJAX just yet.

Here are the partials being displayed in the accordion panel selections:

First panel:




<div class="form">


<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'job-opening2-form',

	'enableAjaxValidation'=>false,

)); ?>

	<?php echo $form->checkBox($job_profile,'indiv_contr', array('checkedValue'=>2, 'uncheckValue'=>0)); ?>

		<td>I am an individual contributor</td>

<br><br>

<b>My work involves</b> (Check All that Apply):


<table><tr><td>	<?php echo $form->checkBox($job_profile,'bus_dev', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Actively pursuing creative solutions to identify gaps or problems of potential new clients, not selling from a book of products. Also M&A Deal & Capital Transactions.</td></table>

<table><tr><td>	<?php echo $form->checkBox($job_profile,'outside_sales', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Activily meeting with clients to close deals in person on a regular basis.</td></table>

<table><tr><td>		<?php echo $form->checkBox($job_profile,'inside_sales', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>In an office, placing outbound calls, closing sales on a regular basis over the phone or Web-EX.</td></table>	

<table><tr><td>		<?php echo $form->checkBox($job_profile,'channels', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Selling to someone who will resell their products, not directly closing deals with the end user. Could be through a distribution channel.</td></table>

<table><tr><td>		<?php echo $form->checkBox($job_profile,'acct_mgrs', array('A.) Business Development'=>1, 'uncheckValue'=>0)); ?>

<td>Over 50 percent of time is spent with existing customers to close deals.</td></table>

		

<?php $this->endWidget(); ?>

</div>




and the second panel:




<div class="form">


<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'job-opening1-form',

	'enableAjaxValidation'=>false,

)); ?>

		<?php echo $form->checkBox($job_profile,'sales_lead', array('value'=>1, 'uncheckValue'=>0)); ?>

		<td>I lead sales people</td>

<br><br>

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'num_direct_reports', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50-100',

					'100'=>'100+'),

					array('prompt' => 'none')

					); 

?>

<td>Number of Direct Reports? (People you lead)</td></table>

</td></td></tr></table>

<b>The teams that I lead have the following number of people</b> (Set All that Apply):

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'bus_dev_num', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50+'),

					array('prompt' => 'none')

					); 

?>

<td>This team actively pursuing creative solutions to identify gaps or problems of potential new clients, not selling from a book of products. Also M&A Deal & Capital Transactions.

</td></td></tr></table>

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'outside_sales_num', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50+'),

					array('prompt' => 'none')

					); 

?>

<td>Activily meeting with clients to close deals in person on a regular basis.</td></table>

</td></td></tr></table>

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'inside_sales_num', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50+'),

					array('prompt' => 'none')

					); 

?>

<td>In an office, placing outbound calls, closing sales on a regular basis over the phone or Web-EX.</td></table>	

</td></td></tr></table>

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'channels_num', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50+'),

					array('prompt' => 'none')

					); 

?><td>Selling to someone who will resell their products, not directly closing deals with the end user. Could be through a distribution channel.</td></table>

</td></td></tr></table>

<table><tr><td>	<?php echo $form->dropDownList($job_profile, 'acct_mgrs_num', 

					array('1' => '1', '2' => '2','3' => '3', '4' => '4','5' => '5', '6' => '6','7'=>'7'

					,'8'=>'8','9'=>'9','10'=>'10','11'=>'11-15','16'=>'16-20','21'=>'21-50+','50'=>'50+'),

					array('prompt' => 'none')

					); 

?><td>Over 50 percent of time is spent with existing customers to close deals.</td></table>

</td></tr></table>

<?php $this->endWidget(); ?>

</div>






You’ll need one form to submit all the fields.

I would do something like,




<?php $form=$this->beginWidget('CActiveForm', array(

  'id'=>'job-opening-form',

  'enableAjaxValidation'=>false,

)); ?>


//Accordion here with fields.


<?php $this->endWidget(); ?>



thanks, I would do that. How would the panel look for the form? That is, how would I do it without a renderPartial. And do I put this form out within my main form by a renderPartial?

Okay - someone has to be using forms in the panel. Is there anyone using two panels with separate forms? I cannot get the second form to fill in. I even did the following with two widgets, but which ever one I put first gets populated the second is out of luck! Help anyone!!!




<?php 

	$this->widget('zii.widgets.jui.CJuiAccordion',array(

    'panels'=>array(	

		'Leading Sales People'=>$this->renderPartial('_partial_leading_sales_people',

			array('job_profile'=>$job_profile,),true),

    ),

    // additional javascript options for the accordion plugin

    'options'=>array(

    	'active'=>true,

    	'atuotHeight'=>false,

        'animated'=>'bounceslide',

    	'alwaysOpen'=>false,

    	'collapsible'=>true,

    ),

));

?>

<?php 

	$this->widget('zii.widgets.jui.CJuiAccordion',array(

    'panels'=>array(	

		'Individual Contributor'=>$this->renderPartial('_partial_indiv_contrib',

			array('job_profile'=>$job_profile),true),	

    ),

    // additional javascript options for the accordion plugin

    'options'=>array(

    	'active'=>true,

    	'atuotHeight'=>false,

        'animated'=>'bounceslide',

    	'alwaysOpen'=>false,

    	'collapsible'=>true,

    ),

));

?>