0

I have searched for days and can find no answers that solve my problem. I have a simple web-form website, on it are some text-boxes that show when the user selects the "custom search" option. When I test locally it works, but when I publish it to our web-server the text-boxes stop working. I noticed that the hover cursor on the web-server switches from the expected "text" cursor to the "pointer" cursor. The "text" cursor shows If I move the cursor to the edge of the text-box, and allows me to click the text-box and type text as needed, but when I move the mouse so no part of it is touching the edge of the text-box (but is inside the text-box) then it becomes the pointer cursor and no matter how hard I press the mouse button I can not activate the text-box to type in it. If I make a selection on the drop-down list first, and click tab, focus will move to the text-box.

Here is the mark-up code of the text-boxes:

<asp:Label ID="lbl_Fname" Text="First Name" CssClass="FN-lbl" runat="server" />
<asp:DropDownList ID="ddl_Fname" CssClass="FN-drop" Width="12%" runat="server">
    <asp:ListItem Value="0">-- Select One --</asp:ListItem>
    <asp:ListItem Value="=">equals</asp:ListItem>
    <asp:ListItem Value="<>">does not equal</asp:ListItem>
    <asp:ListItem Value="&gt;">greater than</asp:ListItem>
    <asp:ListItem Value="&gt=">greater than or equal to</asp:ListItem>
    <asp:ListItem Value="&lt;">less than</asp:ListItem>
    <asp:ListItem Value="&lt;=">less than or equal to</asp:ListItem>
    <asp:ListItem Value="like">contains</asp:ListItem>
    <asp:ListItem Value="not like">doesn&#39;t contain</asp:ListItem>
</asp:DropDownList>&nbsp;&nbsp;
<asp:TextBox ID="txt_Fname" CssClass="FN-txt" Width="16%" runat="server"></asp:TextBox>

Here is the Css entry (note: the comment isn't in my CSS just here on this posting):

.FN-txt
        {
            position: absolute; 
            left: 320px; 
            top: 120px; 
            width: 100px; 
            height: 20px; 
            cursor: text; /*an attempt to get the cursor to behave, it didn't help*/
        }

I've reviewed every post on stack-overflow regarding asp.net and text-boxes, and code project, and logged many hours in google (or blackle.com) word-smithing my search terms. I attempted to post a picture of the GUI, but apparently noobs can't post pictures.

----------------- Follow up notes ------------------------ Here is the code I added to the markup:

OnSelectedIndexChanged="ddl_Email_SelectedIndexChanged" AutoPostBack="true"

Here is the code behind:

protected void ddl_Fname_SelectedIndexChanged(object sender, EventArgs e)
{
    if (ddl_Fname.SelectedValue != "0")
    {
        txt_Fname.Focus();
    }
}

Now I want to know why this should of fixed it. I attempted mtzaldo's solution and by adding it to just Fname, when I saw that a combination of my changes and his suggestion seemed to do the trick, I removed his z-index from the CSS and tested it again and it still was working.

BradAtCC
  • 41
  • 1
  • 10

2 Answers2

0

In the css class try to add a big z-index value. ie z-index:999; If this works it's because a element if over your textbox and it does have a transparent background.

Edit: are you using different browsers? like IE to test the deployed version and FF to test your local version?

mtzaldo
  • 105
  • 4
  • Well, this is weird. I added the z-index to the first and last name and suddenly it worked in all of them. But, I also added some extra code to it (on the dropdowns I added: `OnSelectedIndexChanged="ddl_Fname_SelectedIndexChanged" and AutoPostBack="true" along with some code-behind which when anything except "-- Select One --" was chosen, it would: txt_Fname.Focus();` So, I removed the z-indexs and apparently my code fixed it. The weird thing is that it doesn't seem like this should of fixed it. – BradAtCC Jul 08 '13 at 21:38
  • It's after hours at work so I'm wondering if less people on the web-server is helping this work too. I'll wait until tomorrow to close this question, in case that is the issue. Thanks. – BradAtCC Jul 08 '13 at 21:43
  • clear the cache of the browser, because sometimes the browser cached the css, and try again. or you can test the deployed version with the developer tools you have in the web browser (f12 for IE) and modify the css of the textboxes. – mtzaldo Jul 08 '13 at 22:16
  • Ok, so it's still working this morning when the throughput is much higher. Now I'm curious why my code change would of "fixed" this issue...because it doesn't seem like it should of. Here is the code I added to the markup: – BradAtCC Jul 09 '13 at 12:42
  • I added my notes to the question above...as there is no room in these comment fields for code... – BradAtCC Jul 09 '13 at 12:52
  • Just noticed I used the email ddl for the sample code above and the Fname procedure. I have a set of six of these Lname, Fname, Email, etc. No issue using the wrong one in different snipets. Oh, and to answer a question Mtzaldo asked, I was using work's standard browser, IE, in all cases. – BradAtCC Jul 09 '13 at 17:19
0

I believe the solution was adding "cursor: text" to the CSS, and that it just took clearing the cache before I could see the issue fixed.

BradAtCC
  • 41
  • 1
  • 10