Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Preventing tabs in a modal overlay

Posted on 2013-11-11
1
Medium Priority
?
903 Views
Last Modified: 2013-11-12
I'm using a Telerik control which sets a modal overlay across a page while a modal dialog is showing.

Here is the div for the overlay:

<div unselectable="on" class="TelerikModalOverlay" style="position: absolute; left: 0px; top: 0px; z-index: 7999; background-color: rgb(170, 170, 170); opacity: 0.5; width: 1147px; height: 969px;"></div>

Open in new window


The trouble is it is still possible to tab onto some of the elements on the page below - is there some extra attribute I can set on this div that will prevent the user being able to tab off the modal dialog and onto the page below?
0
Comment
Question by:purplesoup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 2000 total points
ID: 39640907
You can handle the elements focus outside the popup.
If an element gets the focus and it's outside the popup, put the focus on the first element of the popup.

In the following demo I simulate this with 2 areas.
Area two behaves like your popup, and the button toggles the area visibility.
While area 2 is visible you won't be able to focus outside its controls.
http://jsfiddle.net/GF7Ba/4/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question