2 Forms In 2 Tabs [Solved]

I am trying to create a page that has three tabs, two of which contain separate forms. These forms are used separately in several other places so ideally I would rather just render them in on this page rather than creating a separate page.


Yii::app()->clientScript->registerCssFile(CHtml::encode(Yii::app()->request->baseUrl) .'/css/contact.css');            




                //this is a view with an active form

               'Disclosure Info'=>$this->renderPartial('index', array('entity'=>$entity), true, false),

                //this is also a view with an active form

               'Contact Info'=>$this->renderPartial('contacts', array('contact'=>$contact), true,false),        

                //this is a view with no form

               'Contact Sheet'=> $this->renderPartial('//indContact/view', array('contact'=>$contact,   

                                                      'rend'=>$renderer), true, false), 






In the main layout I also have a ‘jnotify’ widget that is responsible for giving system messages.

The problem I’m running into is this:

If I render the views with the last parameter for renderPartial set to true then there is a conflict with the

jnotify widget and I get an error that causes other scripts on the page to break. I’m pretty certain that this is due to jquery being registered more than once.

If I render the views with processoutput set to false, then everything renders great and there is no conflict, but the ajax validation doesn’t work. There is no error, it simply doesn’t run and all other scripts work. It is important to note that this is only true if I render both of the forms. If I comment out either of the tabs that render a form view then ajax validation works again.

To RECAP, rendering the views with processoutput causes a conflict with the jnotify script in the main layout which breaks any script that uses it, but the rest of the page works fine. Both forms can use ajax validation just fine.

Rendering the views without processoutput eliminates the conflict with the jnotify script but causes the ajax validation to stop working. Rendering only one of the two form tabs allows ajax validation to start working again, even with processoutput set to false.

I’m not really sure what to do here. If I tell the clientscript to not register jquery in any of the views (like you would for jquery popups) it just breaks. I would really appreciate some help.

As it turns out the issue was coming from the messaging code I had written. The code tried to add messages to a script that wasn’t existing when renderPartial was called (because the notifications were in the layout portion of the site).