2

I am creating a very simple form to add information to my database. The button changes the style of two elements from display:none to display:block. That works. But the issue is that the form text boxes aren't selectable. When I click or double click the form, the background is selected....I can't explain why. I've never seen this happen before.

The published website is www.impossibleparty.com/private/bookingList.php

The code is below:

Pertinent info: I'm not a beginner with website design, html, css, or php so you can ignore the imperfections in the code layout. I only included the pertinent section. The tag is there as well as all necessary headers. None of that is a problem. I haven't tried in IE, but the problem exists in Safari 8.0.3 and Firefox 39.0. I wrote the code in dreamweaver. Any other questions, feel free to ask. I haven't encountered this problem before.

Thanks!!

<body style='background: url(../images/IEwebBackground.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; min-width: 800px; margin:0; padding:0;'>

   <div id='container'>

      <div id='banner'>

        <img id="bannerImg1" src="../images/IEwebBanner.jpg" width="100%"/>

        <img id="bannerImg2" src="../images/textWhite.png" width="40%" alt="Impossible Entertainment"/>



      </div><!--End banner-->



  <!--Main DIV LEAVE STYLE HERE-->
  <div id='main' style="background-image: url(../images/IEwebForegroundLong.jpg); 
background-origin:content-box; 
background-size:cover; 
background-repeat:repeat-y;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
position:relative;
height:65rem;
z-index:0;">

   <img id='navBar' src="../images/IEwebNavBar2.png" style="width:90%; height:5%; left:5%;"/>

       <div id="Left" style="float:left; width:70%; z-index:4;">

          <div id="addEvent" style="z-index:6;">
              <form name="bookingList" method="post" action="../private/bookingListForm.php">

                      <!--These buttons make different things visible-->
                      <!--The <p> tags are temporary just for easier layout. They did not change the problem-->
                   <p>
                      <button id="button1" type="button" onclick="document.getElementById('specEvent').style.display='block';document.getElementById('button1').style.display='none';document.getElementById('eventName').style.display='block';document.getElementById('button2').style.display='none'">Special Event</button>
                       <button id="button2" type="button" onclick="document.getElementById('weekEvent').style.display='block';document.getElementById('button2').style.display='none';document.getElementById('eventName').style.display='block';document.getElementById('button1').style.display='none'">In Week Event</button>
                  </p>


                        <!--These become visible after a button is pressed. This works-->
                            <label id="specEvent" style="display:none" for="event_name">Event Name</label>

                            <label id="weekEvent" style="display:none;" for="event_name">Event Name</label>

                            <input id="eventName" style="display:none;" type="text" name="event_name" maxlength="50" size="30">


                   <!--These are the forms that are not selectable. Sometimes they work, sometimes they don't....But they never all work at the same time-->
                   <p>     
                            <label for="vendor_name">Venue Name *</label>

                            <input  type="text" name="vendor_name" maxlength="50" size="30">
                   </p> 

                       <p> 
                            <label for="contact_name">Contact Name *</label>

                            <input  type="text" name="contact_name" maxlength="50" size="30">
                       </p> 

                       <p> 
                            <label for="vendor_phone">Venue Phone Number *</label>

                            <input  type="text" name="vendor_phone" maxlength="50" size="30">
                       </p>

                       <p>
                            <label for="contact_title">Contact Title *</label>

                            <input  type="text" name="contact_title" maxlength="50" size="30">
                       </p>
            </form>
        </div><!--End addElement div-->
      </div><!--End Left div-->
     </div> <!--End main div-->
   </div><!--End container div-->
</body><!--End body tag-->
krose
  • 390
  • 1
  • 6
  • 18
  • The weird part is that everything can be selected by hitting the "tab" button and sorting through the page. – krose Aug 07 '15 at 23:02
  • The table is the background ? Make the `z-index` of the form larger than 6 ? – frz3993 Aug 07 '15 at 23:08

2 Answers2

1

I don't really see a z-index issue. Maybe it is. I didn't test out your code. However, I do see a float:left; in there and it immediately raised a flag lol. Floating an element collapses it. You should look at this post, which explain much in detail, What is a clearfix?

Community
  • 1
  • 1
RisingSun
  • 1,693
  • 27
  • 45
  • This was the exact problem. As soon as I removed the "float:left" style, everything worked how it should have. – krose Aug 08 '15 at 04:35
0

Add z-index: 10; position: relative; to div #Left, I try in firebug and works fine.

<div id="Left" style="float:left; width:70%; z-index: 10; position: relative;">
  <!-- stuff inside -->
</div>
Akul Von Itram
  • 1,428
  • 2
  • 20
  • 31