Zend/PHP: How to disable webpage behind popup ?
- by NAVEED
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