开发者

Zend form using dojo : How do i get Parentname for textbox which is in tabcontainer?

I am using zend d开发者_开发问答ojo form: i created tab using

<?php $this->tabContainer()->captureStart('main-container', array('design' => 'headline'),
                        array( 'style'=>'height:450px;width:500px' ));
      echo $this->contentPane('tab1',"<div>User Name: $this->form->txtUserName</div>",
                array('region' => 'top','title'=>'General Info'),
                array('style' => 'background-color: white;') );
      echo  $this->contentPane('Contact Info',
                            "<div>User Name: $this->form->txtPassword</div>",
                             array('region' => 'left', 'title'=>'Contact Info'),
                     array('style' => 'width: 200px; background-color: white;') );
      echo $this->tabContainer()->captureEnd('main-container'); ?>

when i am click button i got error using from.validate() , but when tab "contact info" opened and i click on button than it will display message on left side corner.

How Do i get textBox "id" which has error occured and open tab in which that textbox contained.


this is javascript function:

**function getParentname(error_id){

for(var p=dijit.byId(error_id).domNode.parentNode; p; p=p.parentNode){

 var id = p.getAttribute && p.getAttribute("widgetId");

    if(id){

        var parent = dijit.byId(id);
        return parent.isContainer ? parent : null;
}
} 

}`** where error_id is your textbox id.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜