这个问题可能听起来很疯狂,但每次我在表单上放置javascript或jquery 代码时,
当我在HTML 5文本框上输入日期消失时,但当我刷新页面时,文本会回来。
我不知道我的代码发生了什么
这是我的标记:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="myClaimForm.aspx.cs" Inherits="myAsiaIns.myClaimForm" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>File A claim </title>
<link rel="stylesheet" type="text/css" href="Styles/_clientLandingPage.css" />
<link rel="stylesheet" type="text/css" href="Styles/_claimFormContents.css" />
<link rel="stylesheet" type="text/css" href="Styles/_responsiveClaimForm.css" />
<style type="text/css">
#title {
width: 970px;
}
#homecontents {
width: 1187px;
height: 863px;
}
#registration {
height: 238px;
}
A{text-decoration:none;
color: #27AE60;
font-size: small;
}
.myLink
{
color:#888888;
text-decoration: none;
font-size: medium;
}
.myLink:hover
{
color: white;
text-decoration:underline;
}
.myTextbox
{
-moz-border-radius: 10px;
border-radius: 10px;
}
.auto-style1 {
color: #F39C12;
}
#claimformisprintable {
height: 1181px;
}
#natureofloss {
height: 68px;
}
#decorator1 {
width: 619px;
height: 72px;
}
#decoratorcontents {
height: 46px;
}
input[type=date]::-webkit-inner-spin-button {
-webkit-appearance: none;
display: none;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript"></script>
<script src="Scripts/jquery.blockUI.js" type="text/javascript"></script>
<script type ="text/javascript">
$(document).ready(function () {
$('#ddlDrivers').change(function () {
$.blockUI({
message: '<h1>Please Wait.</h1>',
css: {
border: '1px solid black',
padding: '15px',
backgroundColor: 'white',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
color: 'Black',
size: '10px'
}
});
setTimeout($.unblockUI, 2000);
});
});
</script>
</head>
<body id="myClaim">
<form id="claimformmain" runat="server">
<div id="logo">
<div id="logoleft">
<div id="holder">
<div id="companyname">
<br />
<br />
<asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Logo.png" draggable="false" Height="98px" Width="239px" />
</div>
<div id="spacer"></div>
<div id="homelink">
<br />
<asp:HyperLink ID="HyperLink1" runat="server" style="font-size: medium; " CssClass="myLink" NavigateUrl="~/Default.aspx">Home</asp:HyperLink>
</div>
<div id="clientslink">
<br />
<asp:HyperLink ID="HyperLink2" runat="server" style="font-size: medium; " CssClass="myLink" NavigateUrl="~/clientLandingPage.aspx">Clients</asp:HyperLink>
</div>
<div id="extranetlink">
<br />
<asp:HyperLink ID="HyperLink3" runat="server" style="font-size: medium; " CssClass="myLink" NavigateUrl="~/extranet-Home.aspx">Extranet</asp:HyperLink>
</div>
<div id="aboutlink">
<br />
<asp:HyperLink ID="HyperLink4" runat="server" style="font-size: medium; " CssClass="myLink" NavigateUrl="~/aboutWebsite.aspx">About</asp:HyperLink>
</div>
</div>
</div>
<div id="logoright">
<div id="holder2">
<div id="welcomeuser">
<br />
</div>
<div id="links">
<br />
<asp:Label ID="lblClaimFormUSER" runat="server" Text="xxxx" style="font-size: small"></asp:Label>
|
<asp:Label ID="lblUniqueID" runat="server" style="font-size: small" Text="XXXX"></asp:Label>
<br />
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">Back </asp:LinkButton>
</div>
</div>
</div>
</div>
<div id="claimform_main">
<div id="decorator1">
<br />
<div id="decoratorcontents">
<asp:Image ID="Image2" runat="server" ImageUrl="~/Images/ClaimFormImages/step1.png" draggable="false"/>
<br />
<asp:Label ID="Label30" runat="server" style="font-size: small" Text="Fill Out Claim Form"></asp:Label>
</div>
</div>
<div id="claimformcontents">
<asp:Label ID="Label1" runat="server" style="font-size: x-large" Text="My Claim Form"></asp:Label>
<br />
<asp:Label ID="Label2" runat="server" Text="We already generated your policy details. Please provide other necessary information. "></asp:Label>
<br />
<br />
<div id="header1">
<asp:Label ID="Label6" runat="server" style="color: #3498DB; font-size: large" Text="General Information"></asp:Label>
</div>
<div id="claimformisprintable">
<div id="claimleft1">
<div id="innerleft1">
<div id="align1">
<asp:Label ID="Label3" runat="server" style="font-size: medium" Text="Issuance Office:"></asp:Label>
</div>
</div>
<div id="innerright1">
<div id="align2">
<asp:Label ID="lblIssuanceOffice" runat="server" style="font-size: medium" Text="[issuanceoffice]" CssClass="auto-style1"></asp:Label>
</div>
</div>
</div>
<div id="claimright1">
<div id="innerleft2">
<div id="align3">
<asp:Label ID="Label4" runat="server" style="font-size: medium" Text="Policy Number:"></asp:Label>
</div>
</div>
<div id="innerright2">
<div id="align4">
<asp:Label ID="lblPolicyNumber" runat="server" CssClass="auto-style1" style="font-size: medium" Text="[Policy Number]"></asp:Label>
</div>
</div>
</div>
<div id="natureofloss">
<div id="claimleft2">
<div id="innerleft3"><div id="align5">
<asp:Label ID="Label5" runat="server" style="font-size: medium" Text="Nature of Loss:"></asp:Label>
</div></div>
<div id="innerright3"><div id="align6">
<asp:DropDownList ID="drpNatureofLoss" runat="server" Width="230px">
</asp:DropDownList>
</div></div>
</div>
<div id="claimright2">
</div>
</div>
<br />
<div id="header2">
<asp:Label ID="Label7" runat="server" style="color: #3498DB; font-size: large" Text="Driver's Information"></asp:Label>
</div>
<div id="adddriversinstruct">
<asp:Label ID="Label8" runat="server" style="font-size: small" Text="Choose from drivers that you added. Choose others option to specify the driver during the accident."></asp:Label>
<br />
<asp:Label ID="Label9" runat="server" style="font-size: small" Text="All fields are mandatory."></asp:Label>
</div>
<div id="claimleft3">
<div id="innerleft4"><div id="align7">
<asp:Label ID="Label10" runat="server" style="font-size: medium" Text="Driver's Name:"></asp:Label>
</div></div>
<div id="innerright4"><div id="align8">
<asp:DropDownList ID="ddlDrivers" runat="server" AutoPostBack="True" Width="230px" OnSelectedIndexChanged="ddlDrivers_SelectedIndexChanged" onblur="return CheckBlank(this)">
</asp:DropDownList>
</div></div>
</div>
<div id="claimright3">
<div id="innerleft5"><div id="align9">
<asp:TextBox type="text" ID="txtDriverInput" runat="server" BorderStyle="None" Height="16px" Visible="False" Width="234px" placeholder="Input Driver's Name Here" required="true"></asp:TextBox>
</div></div>
<div id="innerright5"><div id="align10"></div></div>
</div>
<div id="claimleft4">
<div id="innerleft6"><div id="align11">
<asp:Label ID="Label11" runat="server" style="font-size: medium" Text="License Type:"></asp:Label>
</div></div>
<div id="innerright6"><div id="align12">
<asp:DropDownList ID="drpLicenseType" runat="server" Width="230px" Enabled="False">
<asp:ListItem>Select</asp:ListItem>
<asp:ListItem></asp:ListItem>
</asp:DropDownList>
</div></div>
</div>
<div id="claimright4">
<div id="innerleft7"><div id="align13">
<asp:Label ID="Label12" runat="server" style="font-size: medium" Text="License Number:"></asp:Label>
</div></div>
<div id="innerright7"><div id="align14">
<asp:TextBox class="validate[required]" type="text" ID="txtLicNum" runat="server" BorderStyle="None" Width="230px" placeholder="N01-21-031576" Enabled="False" required="true"></asp:TextBox>
</div></div>
</div>
<div id="claimleft5">
<div id="innerleft8"><div id="align15">
<asp:Label ID="Label13" runat="server" style="font-size: medium" Text="License Restriction:"></asp:Label>
</div></div>
<div id="innerright8"><div id="align16">
<asp:TextBox type="text" ID="txtLicRic" runat="server" BorderStyle="None" Width="230px" placeholder="123" Enabled="False" required="true"></asp:TextBox>
</div></div>
</div>
<div id="claimright5">
<div id="innerleft9"><div id="align17">
<asp:Label ID="Label14" runat="server" style="font-size: medium" Text="License Expiry:"></asp:Label>
</div></div>
<div id="innerright9"><div id="align18">
<asp:TextBox ID="txtLicExp" runat="server" BorderStyle="None" Width="230px" Enabled="False" type="Date"></asp:TextBox>
</div></div>
</div>
<div id="claimleft6">
<div id="innerleft10"><div id="align19">
<asp:Label ID="Label15" runat="server" style="font-size: medium" Text="License Address:"></asp:Label>
</div></div>
<div id="innerright10"><div id="align20">
<asp:TextBox type="text" ID="txtLicAdd" runat="server" BorderStyle="None" Width="230px" placeholder="123 Manila City" Enabled="False" required="true"></asp:TextBox>
</div></div>
</div>
<div id="claimright6"></div>
<br />
<div id="header3">
<asp:Label ID="Label16" runat="server" style="color: #3498DB; font-size: large" Text="Accident Information"></asp:Label>
</div>
<div id="claimleft7">
<div id="innerleft11"><div id="align21">
<asp:Label ID="Label17" runat="server" style="font-size: medium" Text="Date of Accident:"></asp:Label>
</div></div>
<div id="innerright11"><div id="align22">
<asp:TextBox ID="txtDateofAccident" runat="server" BorderStyle="None" Width="230px" placeholder="123 Manila City" type="Date"></asp:TextBox>
</div></div>
</div>
<div id="claimright7"><div id="innerleft12"><div id="align23">
<asp:Label ID="Label18" runat="server" style="font-size: medium" Text="Time of Accident:"></asp:Label>
</div></div>
<div id="innerright12"><div id="align24">
<asp:TextBox ID="txtTimeOfAccident" runat="server" BorderStyle="None" Width="230px" placeholder="123 Manila City" type="Time"></asp:TextBox>
</div></div>
</div>
<div id="claimleft8"><div id="innerleft13"><div id="align25">
<asp:Label ID="Label19" runat="server" style="font-size: medium" Text="Accident Information:"></asp:Label>
</div></div><div id="innerright13"><div id="align26">
<asp:TextBox ID="txtAcciInfo" runat="server" BorderStyle="None" Width="230px" type="Text" Height="101px" TextMode="MultiLine" placeholder="write something.." required="true"></asp:TextBox>
</div></div></div>
<div id="claimright8"></div>
<br />
<div id="header4">
<asp:Label ID="Label20" runat="server" style="color: #3498DB; font-size: large" Text="Policy Summary"></asp:Label>
</div>
<div id="claimleft9">
<div id="innerleft14"><div id="align27">
<asp:Label ID="Label21" runat="server" style="font-size: medium" Text="Policy Holder:"></asp:Label>
</div></div>
<div id="innerright14"><div id="align28">
<asp:Label ID="lblPolicyHolder" runat="server" style="font-size: medium" Text="[policyholder]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright9">
<div id="innerleft15"><div id="align29">
<asp:Label ID="Label22" runat="server" style="font-size: medium" Text="Company:"></asp:Label>
</div></div>
<div id="innerright15"><div id="align30">
<asp:Label ID="lblCompany" runat="server" style="font-size: medium" Text="[company]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimleft10">
<div id="innerleft16"><div id="align31">
<asp:Label ID="Label23" runat="server" style="font-size: medium" Text="Address:"></asp:Label>
</div></div>
<div id="innerright16"><div id="align32">
<asp:Label ID="lblAddress" runat="server" style="font-size: medium" Text="[address]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright10">
<div id="innerleft17"><div id="align33"></div></div>
<div id="innerright17"><div id="align34"></div></div>
</div>
<div id="claimleft11"><div id="innerleft18">
<div id="align35">
<asp:Label ID="Label24" runat="server" style="font-size: medium" Text="E-Mail Address:"></asp:Label>
</div>
</div>
<div id="innerright18"><div id="align36">
<asp:Label ID="lblEmail" runat="server" style="font-size: medium" Text="[Eaddress]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright11"></div>
<div id="claimleft12">
<div id="innerleft19"><div id="align37">
<asp:Label ID="Label25" runat="server" style="font-size: medium" Text="Insured Vehicle:"></asp:Label>
</div></div>
<div id="innerright19"><div id="align38">
<asp:Label ID="lblVehi" runat="server" style="font-size: medium" Text="[veh]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright12">
<div id="innerleft20"><div id="align39">
<asp:Label ID="Label26" runat="server" style="font-size: medium" Text="Registered To:"></asp:Label>
</div></div>
<div id="innerright20"><div id="align40">
<asp:Label ID="lblRegTo" runat="server" style="font-size: medium" Text="[reg]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimleft13"><div id="innerleft21"><div id="align41">
<asp:Label ID="Label27" runat="server" style="font-size: medium" Text="Plate Number:"></asp:Label>
</div></div>
<div id="innerright21"><div id="align42">
<asp:Label ID="lblPlateNu" runat="server" style="font-size: medium" Text="[plate]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright13"></div>
<div id="claimleft14">
<div id="innerleft22"><div id="align43">
<asp:Label ID="Label28" runat="server" style="font-size: medium" Text="Engine Number:"></asp:Label>
</div></div>
<div id="innerright22"><div id="align44">
<asp:Label ID="lblEngNu" runat="server" style="font-size: medium" Text="[Eng]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<div id="claimright14">
<div id="innerleft23"><div id="align45">
<asp:Label ID="Label29" runat="server" style="font-size: medium" Text="Serial Number:"></asp:Label>
</div></div>
<div id="innerright23"><div id="align46">
<asp:Label ID="lblSerNu" runat="server" style="font-size: medium" Text="[ser]" CssClass="auto-style1"></asp:Label>
</div></div>
</div>
<br />
<div id="buttons">
<asp:Button ID="btnSubmit" runat="server" BackColor="#3498DB" BorderStyle="None" ForeColor="White" OnClick="btnSubmit_Click" Text="Submit Claim" />
</div>
</div>
</div>
</div>
</form>
</body>
</html>