Zend/PHP: How to disable webpage behind popup ?

Posted by NAVEED on Stack Overflow See other posts from Stack Overflow or by NAVEED
Published on 2010-03-16T11:30:31Z Indexed on 2010/03/17 5:41 UTC
Read the original article Hit count: 340

Filed under:
|
|
|
|

I am working on zend framework, PHP and jQuery. I am working on popups sometimes. When any popup is open on the screen, we can still clicks links on webpage behind popup which causes some unexpected behaviour. How can I disable a webpage behind popup. I have seen some web application in which when popup appears then webpage behind popup become shady.

I have read some tutorial about this. In each tutorial a link is used to open a dialog and an special attribute is added in for modal. But I have a different case I have to open dialog on some condition in action.

I check a condition in action after post like this:

$form = new Edit_Form( );
$this->view->form = $form;
$this->view->form->setAction($this->view->url());

$request = $this->getRequest();
if ( $request->isPost() ) {

   $values = $request->getParams();

   if( $values['edit'] ) {
        $this->view->openEditBox();
   }
}

Now check in view to see that it should open an edit pop or not:

if( $this->openEditBox ){
  $jsonOutput ['content'] = '<div class="DialogBox" title="Edit">' . $this->form->render() . '</div>';
  echo Zend_Json::encode($jsonOutput);
}

Any Idea? Thanks

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about php