Hello,
i create validation value from Textbox which is fired by button (fin working), but is there chance to fire it by tab key? All data which will be putted by barcode scanner.
i found this part for validation empty textbox by tab key
but actually dont know how to merge it
thank you
i create validation value from Textbox which is fired by button (fin working), but is there chance to fire it by tab key? All data which will be putted by barcode scanner.
VB.NET:
Protected Sub ValidateUser_Click(sender As Object, e As EventArgs)
Dim userId As String
getMVSHeaderData()
'Dim constr As String = ConfigurationManager.ConnectionStrings("Data Source =iczfis-report; Initial Catalog = ICZ_LOCAL;Persist Security Info=True;Uid = fisread; password = readfis").ConnectionString
Using con As New SqlConnection("Data Source =iczfis-report; Initial Catalog = ICZ_LOCAL;Persist Security Info=True;Uid = fisread; password = readfis")
Using cmd As New SqlCommand("Validate_Sno")
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@Sno", TextBox5.Text)
cmd.Parameters.AddWithValue("@SubWc", SubWc.Text)
cmd.Parameters.AddWithValue("@PdLine", PdLine.Text)
cmd.Parameters.AddWithValue("@User", User.Text)
cmd.Parameters.AddWithValue("@Po", Po.Text)
cmd.Connection = con
con.Open()
userId = cmd.ExecuteScalar()
con.Close()
End Using
Select Case userId
Case 0
Label1.Text = "Not exist"
Exit Select
Case 1
Label1.Text = "First time"
Exit Select
Case 2
Label1.Text = "Waiting to finish"
Exit Select
Case 3
Label1.Text = "Finished"
Exit Select
End Select
End Using
End Sub
HTML:
<body> <form id="form1" runat="server"> <asp:Button ID="ValidateUser" runat="server" Text="Button" onclick="ValidateUser_Click" /> <br />
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox> <br /> <asp:Label ID="Po" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="SubWc" runat="server" Text="Label">RAI-1</asp:Label> <br /> <asp:Label ID="PdLine" runat="server" Text="Label">CZ0</asp:Label> <br /> <asp:Label ID="User" runat="server" Text="Label">1300245</asp:Label> <br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
</form></body>
i found this part for validation empty textbox by tab key
VB.NET:
<script type="text/javascript">
function requird(tabkey) {
if (tabkey.value == "") {
alert("Fill TextBox Don't be a Blank ");
tabkey.focus();
}
}
</script>
<asp:TextBox ID="TextBox5" runat="server" onblur="requird(this)"></asp:TextBox>
but actually dont know how to merge it
thank you