[Extension] Selectable Formparts (FormPartSelector)

Hi,

this is just a tiny Extension or Widget , allows you to create a form containing different parts, the user can select one to fill out.

I've used the CTabView Widget to create this one.

Hope this helps someone else (it helps me of course)

from munich,

ice

Hi, I have just tested your extension and it works very well.

I would add following into the renderBody()  to also have a legend in the fieldsets.



if(isset($part['legend']))


	echo '<legend>'.$part['legend'].'</legend>';


above this line 'if(isset($part['content']))'

Also add the 'bitte wählen' and '----' option via htmloptions in renderHeader()



$htmlOptions=array('id'=>'PartSelector','prompt'=>'Bitte auswählen','empty'=>'----------------');


...


echo CHtml::dropDownList('PartSelector', $this->activePart, $dropDownData, $htmlOptions);


And not use -2 -1 as value for it.

With this change you could also change the jquery code and check for a value of the selected option and only change the display if a value is given.



	if (jQuery("'.$partSelectorSelector.'").val())


	 showFormPart(jQuery("'.$partSelectorSelector.'").val());


Everything else is quite good

gruß aus Heidelberg ;)

Regards Horizons