Div over textbox, can't select the textbox as used to!

I have a div over all of the forms inside of a asp.net page.

All form are clickable but only the textbox and the textarea aren't.

if i want to click in the textbox i don't get the prompt in the controls.

My div looks like this:
<div style="position:absolute; top:180px; width:980px; height:2000px; z-index:101;"></div>

While my textbox looks like this:
<asp:TextBox ID="myTextBox" runat="server" Width="160px"></asp:TextBox>

I've tried putting an z-index to the textbox also , bigger as value but it didn't helped!

Any ideas?

Thanks.
LVL 1
drcyrus3dAsked:
Who is Participating?
 
JezcentralConnect With a Mentor Commented:
Give the input a z-index AND a position: absolute; (Just no left or top).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
<head>
    <title>Test</title>
    <style type="text/css">

    </style>
</head>
 
<body>
<form id="form1" name="form1" method="post" action="">
  <input style="position: absolute; z-index: 20001;" type="text" name="textfield" id="textfield" /><br /><br />
  <textarea name="textarea" id="textarea" cols="45" rows="5">This is just an example!</textarea><br /><br />
  <select name="a">
  <option value="a1">a1</option>
  <option value="a2">a2</option>
  <option value="a3">a3</option>
  <option value="a4">a4</option>
  <option value="a5">a5</option>
  </select>
</form>
<div style="position:absolute; top:0px; left:0px; width:1500px; height:1500px; z-index:10001;"></div>
 
Open in New Window
</body>
</html>
0
 
JezcentralCommented:
Sorry, I don't understanbd what you are trying to do. Can you try to explain in a little more detail, or maybe give me a URL to go to so I can see what you mean?

Cheers. :)
0
 
drcyrus3dAuthor Commented:
Hi Jez,

I've pasted you a short example of what i am trying to do.
My problem is that i can't select the textbox or the textarea as you could do it usualy!

The Selectbox works perfectly, when i want to select a value from it.

Any ideas? I know it's a css catch, but i'm totaly out of any ideas!

Thanks.
<form id="form1" name="form1" method="post" action="">
  <input type="text" name="textfield" id="textfield" /><br /><br />
  <textarea name="textarea" id="textarea" cols="45" rows="5">This is just an example!</textarea><br /><br />
  <select name="a">
  <option value="a1">a1</option>
  <option value="a2">a2</option>
  <option value="a3">a3</option>
  <option value="a4">a4</option>
  <option value="a5">a5</option>
  </select>
</form>
<div style="position:absolute; top:0px; left:0px; width:1500px; height:1500px; z-index:10001;"></div>

Open in new window

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
JezcentralCommented:
The select box could be a known IE bug where, like a flash movie, or a Windows Media Player, you can't put an HTML element on top of it.

If you try this code in Firefox, you can't click on any of the form boxes, even the SELECT box, which is correct behaviour, as there is a DIV hanging in front of them.

Are you trying to disable the forms? You are better off using "disable='true' " in the HTML.
Then, when you want to enable the form element again, just use a simple javascript:
document.formXXX.elementXXX.disabled=false; fired by a mouseevent (usually an onclick/onblur on the element you needed filled in before they could fill in these ones).

Is this what you are after? :)
0
 
drcyrus3dAuthor Commented:
Unfortunately no. The div is above my form and serves as an control for other components.

I want to be able to click the textbox and the texarea in IE.

I am interested only on the IE side of it (like IE7).
0
 
drcyrus3dAuthor Commented:
Thanks for the solution! It worked. :) I knew it had to be something very easy.
0
All Courses

From novice to tech pro — start learning today.