📄 index.jsp
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head> <title>Drools Insurance Company</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="drools.css" media="screen" rel="Stylesheet" type="text/css"> <script language = "Javascript"> function validateNumber(number){ var i; var s = number.value; for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (((c < "0") || (c > "9"))) { alert("The "+ number.name +" field should be numeric"); return false; } } return true; } function validateMoney(money) { var format = /^\d+\.\d{2}$/; if(money.value.length !=0 && format.test(money.value)) { return true; } alert( money.name + " should be a valid currency value"); return false; } function validateDate(fld) { var RegExPattern = /^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2}))($|\ (?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(\ [AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$/; var errorMessage = 'Please enter valid date as month, day, and four digit year.\nYou may use a slash, hyphen or period to separate the values.\nThe date must be a real date. 2-30-2000 would not be accepted.\nFormay mm/dd/yyyy.'; if ((fld.value.match(RegExPattern)) && (fld.value!='')) { return true; } else { alert(errorMessage); return false; } } function ValidateForm(){ var dt = document.frmSample.txtDate if (validateDate(dt) == false){ dt.focus() return false } return true } </script></head><body><div id="header"> <div class="area"> <div class="column"> <ul class="options"> <li class="new"><a href="#"><span>Drools Insurancea Company</span></a></li> </ul> </div> </div></div><form action="InsuranceServlet" method="get" accept-charset="utf-8" > <table width="600" height="236" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#999999" class="seucorretor6"> <tbody> <tr class="seucorretor6"> <td class="seucorretor2" align="center"> <div align="left"><b>Driver's information</b></div> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF" valign="top"> <div align="left"><br> <table border="0" cellpadding="3" cellspacing="0" width="584"> <tbody> <tr> <td width="162" class="c1">Genre:</td> <td width="363"><select name="sexo"> <option value=0 <% if (request.getParameter("sexo") == "0") { out.print("selected='selected'"); } %>> Male </option> <option value=1 <% if (request.getParameter("sexo") == "1") { out.print("selected='selected'"); } %>>Female </option> </select></td> </tr> <tr> <td class="c1">Birth Date:</td> <td> <input type="text" name="birthdate" onblur="validateDate(this);" value="<% out.print(request.getParameter("birthdate"));%>">> (mm/dd/yyyy) </td> </tr> <tr> <td class="c1">License Age:</td> <td><input name="habilitacao" size="2" maxlength="2" type="text" onblur="validateNumber(this);" value="<% out.print(request.getParameter("habilitacao"));%>"> <span class="c2">Years</span></td> </tr> <tr> <td class="c1">Marital State:</td> <td><select name="estadoCivil"> <option value="0" <% if (request.getParameter("estadoCivil") == "0") { out.print("selected='selected'"); } %> > Single </option> <option value="1" <% if (request.getParameter("estadoCivil") == "1") { out.print("selected='selected'"); } %>>Married </option> </select></td> </tr> <tr> <td class="c1">Has Child?</td> <td><select name="temFilhos"> <option value="1" <% if (request.getParameter("temFilhos") == "1") { out.print("selected='selected'"); } %> >Yes, less than 17 years. </option> <option value="2" <% if (request.getParameter("temFilhos") == "2") { out.print("selected='selected'"); } %> >Yes, Between 17 and 25 years. </option> <option value="3" <% if (request.getParameter("temFilhos") == "3") { out.print("selected='selected'"); } %> >Yes, greater than 26 years old. </option> <option value="0" <% if (request.getParameter("temFilhos") == "0") { out.print("selected='selected'"); } %> >No, I don't have Child </option> </select></td> </tr> <tr> <td class="c1">Degree:</td> <td><select name="escolaridade"> <option value="1" selected="selected">Elementary School</option> <option value="2">High School</option> <option value="3">College</option> <option value="4">MSC or high</option> </select></td> </tr> </tbody> </table> <br> </div> </td> </tr> </tbody> </table><br/><br/> <table width="600" border="0" align="center" cellpadding="0" cellspacing="2" bgcolor="#999999" class="seucorretor6"> <tbody> <tr class="seucorretor6"> <td class="seucorretor2" align="center"> <div align="left"><b>Driver's additional info</b></div> </td> </tr> <tr> <td valign="top" bgcolor="#FFFFFF"> <div align="left"><br> <table width="98%" height="188" border="0" align="center" cellpadding="4" cellspacing="2"> <tbody> <tr> <td width="296" class="c1">Day vehicle place:</td> <td width="266"><select name="garagemDia"> <option value="1" <% if (request.getParameter("garagemDia") == "1") { out.print("selected='selected'"); } %>>Garage </option> <option value="2" <% if (request.getParameter("garagemDia") == "2") { out.print("selected='selected'"); } %>>Parking </option> <option value="0" <% if (request.getParameter("garagemDia") == "0") { out.print("selected='selected'"); } %> >Street </option> </select></td> </tr> <tr> <td class="c1">Night vehicle place:</td> <td><select name="garagemNoite"> <option value="1" <% if (request.getParameter("garagemNoite") == "1") { out.print("selected='selected'"); } %> >Garage </option> <option value="2" <% if (request.getParameter("garagemNoite") == "2") { out.print("selected='selected'"); } %>>Parking </option> <option value="0" <% if (request.getParameter("garagemNoite") == "0") { out.print("selected='selected'"); } %>selected="selected"> Street </option> </select></td> </tr> <tr> <td class="c1">Residence Status:</td> <td><select name="condicaoImovel"> <option value="1" <% if (request.getParameter("condicaoImovel") == "1") { out.print("selected='selected'"); } %> >Owned </option> <option value="0" <% if (request.getParameter("condicaoImovel") == "0") { out.print("selected='selected'"); } %>>Rent </option> </select></td> </tr> <tr> <td class="c1">Actual Job:</td> <td><select name="profissao"> <option value="0" <% if (request.getParameter("profissao") == "0") { out.print("selected='selected'"); } %> >Unemployed </option> <option value="1" <% if (request.getParameter("profissao") == "1") { out.print("selected='selected'"); } %>>Business owner </option> <option value="2" <% if (request.getParameter("profissao") == "2") { out.print("selected='selected'"); } %>>Public employee </option> <option value="3" <% if (request.getParameter("profissao") == "3") { out.print("selected='selected'"); } %>>Private employee </option> <option value="4" <% if (request.getParameter("profissao") == "4") { out.print("selected='selected'"); } %>>Student </option> </select></td> </tr> <tr> <td class="c1">Residence:</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -