gpt4 book ai didi

javascript - 在文本框上使用 javascript 屏蔽输入

转载 作者:行者123 更新时间:2023-11-30 18:37:53 25 4
gpt4 key购买 nike

我正试图在我的文本框中使用 jquery 来屏蔽输入,但它没有做任何事情:

 $(function() {
$("#<%= received_dateTextbox.ClientID %>").mask("99/99/9999");
...
...

我也试过这样:

$('#received_dateTextbox').mask("99-9999999");  

我做错了什么?

我已经包含了这个:

<script type="text/javascript" src="../jquery.maskedinput-1.2.2.js"></script>

这是 html:

<body>
<form id="form1" runat="server">
<div>

<table>
<tr><td>Sample Received Date:</td>
<td><asp:TextBox ID="received_dateTextbox" runat="server"></asp:TextBox></td><td></td><td></td><td></td>..........

这是完整的来源:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LOMForm.aspx.cs" Inherits="EnterData.DataEntry.LOMForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
<style type="text/css" media=screen>
.TreeNodeOver
{
font-family: Tahoma;
font-size: 8pt;
color: black;
text-decoration: underline;
cursor: pointer;
cursor: hand;
padding-left: 3px;
}


<link rel="stylesheet" type="text/css" href="../jquery-ui-1.8.16.custom.css" />

</style>



<script type="text/javascript" src="../jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="../jquery-ui.js"></script>
<script type="text/javascript" src="../jquery.js"></script>
<script type="text/javascript" src="../jquery.maskedinput-1.2.2.js"></script>
<script type="text/javascript" src="../jquery.min.js"></script>
<script type="text/javascript" src="../jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="../jquery.multiselect.js"></script>
<script type="text/javascript">







$(function() {
$("#<%= received_dateTextbox.ClientID %>").mask("99/99/9999");
$('table input:checkbox').click(function() {
if ($(this).prop('checked')) {
var checkText = $(this).next('a').text();
if (checkText.indexOf('Liquid Handler #:') != -1) {
var userInput = prompt("Liquid Handler #:", "Liquid Handler #:");
$(this).next('a').html('Liquid Handler #:' + '<font color="red">' + userInput + '</font>');
}
if (checkText.indexOf('Olympus #:') != -1) {
var userInput = prompt("Olympus #:", "Olympus #:");
$(this).next('a').html('Olympus #:' + '<font color="red">' + userInput + '</font>');
}
if (checkText.indexOf('LC-MS/MS #:') != -1) {
var userInput = prompt("LC-MS/MS #:", "LC-MS/MS #:");
$(this).next('a').html('LC-MS/MS #:' + '<font color="red">' + userInput + '</font>');

}
if (checkText.indexOf('Liquid Handler#:') != -1) {
var userInput = prompt("Liquid Handler#:", "Liquid Handler#:");
$(this).next('a').html('Liquid Handler#:' + '<font color="red">' + userInput + '</font>');

}
if (checkText.indexOf('Olympus#:') != -1) {
var userInput = prompt("Olympus#:", "Olympus#:");
$(this).next('a').html('Olympus#:' + '<font color="red">' + userInput + '</font>');

}
if (checkText.indexOf('LC-MS/MS#:') != -1) {
var userInput = prompt("LC-MS/MS#:", "LC-MS/MS#:");
$(this).next('a').html('LC-MS/MS#:' + '<font color="red">' + userInput + '</font>');

}
if (checkText.indexOf('Wrong Practice Code') != -1) {

var userInput = prompt("Do you want to check Report Sent to Wrong Location/Physician?", "y/n");
if (userInput.indexOf('y') != -1) {
var elNode = document.getElementById("TreeView1n66CheckBox");
$(elNode).prop("checked", true);
}
}
if (checkText.indexOf('Other:') != -1) {
var userInput = prompt("Other:", "Other:");
$(this).next('a').html('Other:' + '<font color="red">' + userInput + '</font>');
}

}
});
});



</script>
</head>
<body>
<form id="form1" runat="server">
<div>

<table>
<tr><td>Sample Received Date:</td>
<td><asp:TextBox ID="received_dateTextbox" runat="server"></asp:TextBox></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>


<tr><td>Site Of Occurrence:</td><td>
<asp:TextBox ID="site_of_occurrenceTextBox" runat="server"></asp:TextBox></td><td>Occurrence Date:</td><td>
<asp:TextBox ID="occurrence_dateTextBox" runat="server"></asp:TextBox></td><td>Report Date:</td>
<td><asp:TextBox ID="report_dateTextBox" runat="server"></asp:TextBox></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>


<tr><td>Specimen ID:</td><td>
<asp:TextBox ID="spec_idTextBox" runat="server"></asp:TextBox></td><td>Batch ID:</td><td>
<asp:TextBox ID="batch_idTextBox" runat="server"></asp:TextBox></td><td>Report Initiated By:</td>
<td><asp:TextBox ID="report_byTextBox" runat="server"></asp:TextBox></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
</table>
<table>

<tr><td>Problem Identified By:</td>
<td>
<asp:CheckBox ID="chkDESpec" runat="server" Text="DE/Spec Res"/></td>
<td>
<asp:CheckBox ID="chkLAB" runat="server" Text="LAB"/>
<asp:CheckBox ID="chkCLS" runat="server" Text="CLS"/>
<asp:CheckBox ID="chkPractice" runat="server" Text="Practice"/>
<asp:CheckBox ID="chkBilling" runat="server" Text="Billing"/>
<asp:CheckBox ID="chkSalesRep" runat="server" Text="Sales Rep"/>
<asp:CheckBox ID="chkOther" runat="server" Text="Other:"/>

<asp:TextBox ID="otherTextBox" runat="server"></asp:TextBox></td><td></td><td></td><td></td><td></td><td></td></tr>
</table>



</div>


<asp:TreeView ID="TreeView1" runat="server" ShowLines="True"
onselectednodechanged="TreeView1_SelectedNodeChanged"
ontreenodecheckchanged="TreeView1_TreeNodeCheckChanged" CssClass="mytreeview"
>
<Nodes>
<asp:TreeNode Text="PreAnalytical" Value="PreAnalytical" Expanded="False">
<asp:TreeNode Text="Labels" Value="Labels" Expanded="False">
<asp:TreeNode Text="Specimen collection device mislabeled/unlabeled by practice"
Value="Specimen collection device mislabeled/unlabeled by practice"
ShowCheckBox="True">
</asp:TreeNode>
<asp:TreeNode Text="Specimen mislabeled: in-house error (Lab or DE)"
Value="Specimen mislabeled: in-house error (Lab or DE)"
ShowCheckBox="True"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Test Requisitions" Value="Test Requisitions"
Expanded="False">
<asp:TreeNode Text="Missing: no form sent with specimen"
Value="Missing: no form sent with specimen" ShowCheckBox="True"></asp:TreeNode>
<asp:TreeNode Text="Wrong (i.e. OT instead of ORAL, sister practice)"
Value="Wrong (i.e. OT instead of ORAL, sister practice)"
ShowCheckBox="True"></asp:TreeNode>
<asp:TreeNode Text="Other: Non-ML" Value="Other: Non-ML" ShowCheckBox="True"></asp:TreeNode>
<asp:TreeNode Text="Copies Received: New ID/Req. assigned"
Value="Copies Received: New ID/Req. assigned" ShowCheckBox="True"></asp:TreeNode>
<asp:TreeNode Text="Incomplete/Blank Requisition Form"
Value="Incomplete/Blank Requisition Form" ShowCheckBox="True"></asp:TreeNode>
<asp:TreeNode Text="2 Specimens: 1 Req" Value="2 Specimens: 1 Req"
ShowCheckBox="True">
</asp:TreeNode>
<asp:TreeNode Text="2 Reqs: 1 Specimen" Value="2 Reqs: 1 Specimen"
ShowCheckBox="True">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Validity" Value="Need POC Results Confirmed"
Expanded="False">
<asp:TreeNode Text="Need POC Results Confirmed" Value="New Node"></asp:TreeNode>
<asp:TreeNode Text="POC Results Marked Incorrectly" Value="New Node">
</asp:TreeNode>
<asp:TreeNode Text="No Tests Ordered" Value="New Node"></asp:TreeNode>
<asp:TreeNode Text="SEC A Unclear" Value="New Node"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Sales" Value="Sales" Expanded="False">
<asp:TreeNode Text="Practice is not entered in database" Value="New Node">
</asp:TreeNode>
<asp:TreeNode Text="CP has not been updated" Value="New Node"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Other" Value="Other" Expanded="False">
<asp:TreeNode Text="Other" Value="New Node"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Analytical" Value="Analytical" Expanded="False">
<asp:TreeNode Text="Reagent Problem" Value="Reagent Problem" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="QC Failure" Value="QC Failure">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="QC Contamination"
Value="QC Contamination"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Absence of INSTD"
Value="Absence of INSTD"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Instrument Problem/Failure"
Value="Instrument Problem/Failure" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Liquid Handler #:"
Value="Liquid Handler #:"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Olympus #:" Value="Olympus #:">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="LC-MS/MS #:" Value="LC-MS/MS #:">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Processing Problem" Value="Processing Problem"
Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Aliquoting/Sample Processing"
Value="Aliquoting/Sample Processing"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Specimen Contamination/Carryover"
Value="Specimen Contamination/Carryover"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Plate Contamination"
Value="Plate Contamination"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Blank Contamination"
Value="Blank Contamination"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Delay in Production" Value="Delay in Production"
Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Liquid Handler#:"
Value="Liquid Handler#:"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Olympus#:" Value="Olympus#:">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="LC-MS/MS#:" Value="LC-MS/MS#:">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Operator Error" Value="Operator Error">
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Post-Analytical" Value="Post-Analytical" Expanded="False">
<asp:TreeNode Text="Data Entry" Value="Data Entry" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Medications" Value="Medications">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Tests" Value="Tests"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Collection Date"
Value="Collection Date"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Patient Name" Value="Patient Name">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="DOB" Value="DOB"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="SSN" Value="SSN"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Requesting Physician"
Value="Requesting Physician"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Wrong Practice Code"
Value="Wrong Practice Code"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True"
Text="Corrected Report - patient name &amp; all demos wrong"
Value="Corrected Report - patient name &amp; all demos wrong">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Practice Error" Value="Practice Error" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Medications" Value="Medications">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Tests" Value="Tests"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Demographics" Value="Demographics">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Sales Support/Client" Value="Sales Support/Client"
Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Wrong Report Template"
Value="Wrong Report Template"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Typo Practice Name or Phyisician"
Value="Typo Practice Name or Phyisician"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="E-mail Address" Value="E-mail Address">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Fax Number" Value="Fax Number">
</asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Custom Profile entered incorrectly"
Value="Custom Profile entered incorrectly"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Sales" Value="Sales" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="CP Update Needed"
Value="CP Update Needed"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Client Education Needed"
Value="Client Education Needed"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Operator Error" Value="Operator Error" Expanded="False">
<asp:TreeNode ShowCheckBox="True"
Text="Report Sent to Wrong Location/Physician"
Value="Report Sent to Wrong Location/Physician"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Laboratory" Value="Laboratory" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="Corrected Report - reporting error"
Value="Corrected Report - reporting error"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Physician Requested Repeat"
Value="Physician Requested Repeat"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other" Value="Other"></asp:TreeNode>
</asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Other" Value="Other" Expanded="False">
<asp:TreeNode ShowCheckBox="True" Text="QuikLab/MLIS Problem"
Value="QuikLab/MLIS Problem"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Practice Complaint"
Value="Practice Complaint"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Shipping (FedEx, UPS)"
Value="Shipping (FedEx, UPS)"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Billing" Value="Billing"></asp:TreeNode>
<asp:TreeNode ShowCheckBox="True" Text="Other:" Value="Other:"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
</asp:TreeView>



<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Submit" />



</form>
</body>
</html>

最佳答案

没有足够的信息来回答这个问题。我会给出以下建议:

  1. 从 JS 控制台查找 Javascript 错误并将其发布到此处(适用于 Firefox 或 Chrome/Safari/IE 开发工具的 Firebug)。
  2. 将您的代码减少到重现问题所需的最低限度,并将其放在 jsFiddle 上并请大家看看。

关于javascript - 在文本框上使用 javascript 屏蔽输入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7730638/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com