The Mysteriously Disappearing Form Tag

I am at a loss to explain what is happening here but I have a search box in my sidebar and on some pages the <form> tag just disappears. Not the code in between, just the lines which contain the <form> tag and the </form> tag. The code snippet is as follows:




      <!-- sidebar -->

      <div class="sidebar">


        <!-- search site -->

        <div class="gadget">

          <?php if (!Yii::app()->user->isGuest) { ?>

            <p class="infopost"><span>Welcome <?php echo Yii::app()->user->getState('firstName'); ?></span></p>

          <?php } ?>


          <div class="searchform">

            <form id="formsearch" name="formsearch" method="get" action="http://www.google.com/search" target="_blank">

              <input type="hidden" id="age" name="sitesearch" value="cashflowyourbusiness.com" />

              <span>

              <input name="q" class="editbox_search cleardefault" id="editbox_search" maxlength="80" value="Search our site:" type="text" />

              </span>

              <input name="button_search" src="<?php echo Yii::app()->theme->baseUrl; ?>/images/search.gif" class="button_search" type="image" />

            </form>

          </div>

          <div class="clr"></div>

        </div>



Anyone have any ideas at all???

Thanks,

Vangelis

After further investigation, it appears the the form tag is actually in the html code but it is not “seen” by Firebug because… CActiveForm has not put in the closing tag for its form!!! Why? Don’t know yet but will investigate further. If anyone has an idea where to look, please let me know otherwise I will rely on time and patience…

Didn’t you forget to call


$this->endWidget()

at the end of the form? :)

Thank you for your suggestion, phtamas. I do call endWidget() but what happened is that in the overridden run() operator, I didn’t call the parent run(). So, I added the call, the form closing tag appears and everything is sweet! Thanks to those who gave suggestions (that’s just you, phtamas) and thanks to all for listening (ie reading) because I find that I solve my problems just by talking about them.

Cheers,

Vangelis

:)