Tooltip Not Working On TextBox At A Time Of Enabled="false" - html

TextBox is Enabled="false", which is why the tooltip is not showing on TextBox.
What should I do to show the ToolTip without changing state of TextBox?
<asp:TextBox ID="txtDescription" data-original-title="Description" Enabled="false" runat="server" Class="txtDescription form-control tooltips"></asp:TextBox>

I use ReadOnly="true" and it's work.
<asp:TextBox ID="txtDescription" data-original-title="Description" ReadOnly="true" runat="server" Class="txtDescription form-control tooltips"></asp:TextBox>

Related

How to change the type of the data in text box?

I want my text box to have a date in it, how do I do it?
<asp:TextBox ID="BirthdayRegBt" runat="server" class="form-control" placeholder="Birthday Date" required=""></asp:TextBox>
You can set the placeholder attribute to indicate a sample value for the field. For Date, there are HTML 5 input types such as date, datetime, datetime-local are available.
for. e.g.
<asp:TextBox ID="TextBox1" runat="server" TextMode="DateTimeLocal" placeholder="12-12-2016" ></asp:TextBox>
html example:
Try this, it will work.
<asp:TextBox Text='<%#DataBinder.Eval(Container.DataItem,"Date", "{0:MM/dd/yyyy}")%>' ID="txtDate" runat="server" placeholder="Date" class="form-control"></asp:TextBox>

What causes the edit method activation in a gridview aspnet

I have an asp:button tag
<asp:Button runat="server" Text="Edit" CommandName="Edit" />
whenever i press it im redirected into the onrowediting event
this is my gridview:
CssClass="fl-table" AllowPaging="true" AllowSorting="true" PageSize="15" RowStyle-CssClass="GvGrid"
OnSelectedIndexChanged="OnSelectedIndexChanged"
OnSorting="gridView_Sorting"
OnPageIndexChanging="GridView_PageIndexChanging"
OnRowEditing="grdIdkun_RowEditing"
OnRowUpdating="grdIdkun_RowUpdating"
OnRowCancelingEdit="grdIdkun_RowCancelingEdit">
<PagerStyle CssClass="cssPager" />
I was wondering how my button knows its time to activate edit method when I press EDIT?
** is the attribute 'commandname' tells it directly, now ure on edit ? so its firing the onrowediting event?
I was also wondering if I could have the functionality of that line:
<asp:Button runat="server" Text="Choose" CommandName="Select"
under the input tag? such as :
<input type="button" runat="server" value="Select" """"(somecommandactivation)="Select"/>
thanks!

Validation Summary MessageBox not displaying

I'm trying to display my Validation Summary in a MessageBox and it simply inst working. Here's what I have.
<asp:ValidationSummary ID="ValidationSummary1" runat="server" Height="24px" Width="100%"ShowMessageBox="True" ShowSummary="False"></asp:ValidationSummary>
<tr>
<td align="right">
<asp:Label ID="Label2" runat="server" CssClass="label" Width="138px">* Serial Number</asp:Label>
</td>
<td>
<asp:TextBox ID="txtSerial" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="valSerial" runat="server"
ControlToValidate="txtSerial" ErrorMessage="Serial number is required" >*</asp:RequiredFieldValidator>
</td>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" Height="20px"></asp:Button>
I have followed every guide I can find on the internet but i can't get it to work.
What am i missing? Thanks!
I answered it. I had <xhtmlConformance mode="Legacy" /> in my web config. This prevented the MessageBox from displaying.

Logout button intercept enter key

I have asp.net page like this: There is a form that contains all, inside it a LoginStatusand some other controls like TextBox and ImageButton.
My problem is that: when we press Enter in the Text box, the LogOut button is pressed, then the user goes out. There is a way to avoid it?
I tried with javascript, but my controls are inside ajax panel and it is very complex, there is a html way?
Regards,
Antonino
Wrap the TextBox or the HTML containing the TextBox with something like this:
<div onKeyDown="return (event.keyCode!=13);"> ... </div>
If you do want something to happen when the enter key is pressed other than the LogOut button you can wrap the content inside a Panel and assign a DefaultButton like this:
<asp:Panel ID="Panel1" runat="server" DefaultButton="Button2">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="LogOut" />
<asp:Button ID="Button2" runat="server" Text="Cancel" />
</asp:Panel>
Now when the enter key is pressed in either TextBox the Cancel button will fire.

SetFocusOnError doesn't work properly

the problem I have is that I have a form (asp.net form) and some of the fields (most of them) have RequiredFieldValidator. Now I also set SetFocusOnError="true" on all of them and it works fine for all but dropdowns. Let me define fine: after clicking on the Submit button while one of the fields is left blank, browser scrolls up to the empty field. In case of dropdowns the error message is indeed displayed properly next to the field however browser will not scroll up the screen to the field. I've read similar questions on stack overflow so far and they all come to "use JavaScript for this", but my problem is that I want to use asp.net property for this. If it's there it's supposed to work, right? Unless I do it wrong. Here comes the code for one of the working fields:
<div class ="row">
<div class="three columns medium" align="right">
<label>Email *</label>
</div>
<div class="three columns large">
<asp:TextBox ID="Email" runat="server"></asp:TextBox>
</div>
<div class="six columns large">
<asp:RequiredFieldValidator ID="EmailRequired" ControlToValidate="Email"
ErrorMessage="Please provide us your email address" forecolor="Red" SetFocusOnError="true" runat="server" /><br />
<asp:RegularExpressionValidator ID="EmailFormat" ControlToValidate="Email"
ErrorMessage="Please provide us valid e-mail address" ValidationExpression="^[^\s#]+#[^\s#]+$" forecolor="Red" runat="server" />
</div>
</div>
and here's a sample of not working focus:
<div class ="three columns medium" align="right">
<asp:DropDownList class="dropdown expand" ID="Location" runat="server">
<asp:ListItem
Enabled="True"
Text="Please choose the office location... *"
Value=""
/>
<asp:ListItem
Enabled="True"
Text="City1"
Value="City1"
/>
<asp:ListItem
Enabled="True"
Text="City2"
Value="City2"
/>
<asp:ListItem
Enabled="True"
Text="City3"
Value="City3"
/>
</asp:DropDownList>
</div>
<div class ="six columns large">
<asp:RequiredFieldValidator ID="LocationRequired" ControlToValidate="Location"
ErrorMessage="Please select the office location" forecolor="Red" SetFocusOnError="true" runat="server" />
</div>
<div class ="three columns large"></div>
Is my code wrong or am I expecting the wrong thing from it?
Set the ValidationGroup property of the each of the controls involved in this, such as the Drop Down List, Button, Required Field Validator etc as
ValidationGroup="Selection"
I afraid that 3rd party scripts like jqTransform break something in asp.net script that is setting focus on error controls. Try to remove 3rd party scripts and check. If they were cause then you need to invent something with java script