Guest User

Untitled

a guest
Jul 20th, 2017
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.46 KB | None | 0 0
  1. <!-- saved from url=(0022)http://internet.e-mail -->
  2. @inherits PortableRazor.ViewBase
  3. @using PortableRazor
  4. @model QuestionModel
  5.  
  6. <!DOCTYPE HTML>
  7. <html lang="en-US">
  8. <head>
  9. <meta charset="utf-8" />
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. @*<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, height=device-height" />*@
  12. <meta name="viewport" content="width=device-width, initial-scale=2, maximum-scale=1, user-scalable=0" />
  13. <title>Tata AIA</title>
  14. <link rel="stylesheet" type="text/css" href="css/style.css">
  15. <link rel="stylesheet" type="text/css" href="css/font-awesome.css">
  16. <script src="jquery-1.11.3.min.js"></script>
  17. <script type="text/javascript">
  18.  
  19. var Que1Final = "Empty";
  20. var Que1Ans = "Empty";
  21. var Que1AnsOther = "Empty";
  22. var Que2AnsAddress = "Empty";
  23. var Que3AnsPinCode = "Empty";
  24. var Que4AnsAnnualIncome = "Empty";
  25.  
  26. var Que5Ans = "Empty";
  27. var Que5Ans_SSC = "Empty";
  28. var Que5Ans_HSC = "Empty";
  29. var Que5Ans_Graduate = "Empty";
  30. var Que5Ans_Diploma = "Empty";
  31. var Que5Ans_Other = "Empty";
  32. var Que5Ans_Education_Other = "Empty";
  33. var Que6AnsNatureofOccupationandDuties = "Empty";
  34.  
  35. var message = "";
  36.  
  37. $(document).ready(function () { // document.getElementById("Check2").checked = true; // Que1Ans = "No";
  38. Que1AnsOther = "Empty";
  39. var textarea = $('textArea');
  40. textarea.hide();
  41.  
  42.  
  43. $("#txt_Others").focus(function () {
  44. $('#mainDiv').css({ marginTop: '-=360px' });
  45. });
  46.  
  47. $('#txt_Others').on('blur', function () {
  48. $('#mainDiv').css({ marginTop: '+=360px' });
  49. });
  50. $("#NatureOfOccupationAndDuties").focus(function () {
  51. $('#mainDiv').css({ marginTop: '-=360px' });
  52. });
  53.  
  54. $('#NatureOfOccupationAndDuties').on('blur', function () {
  55.  
  56. $('#mainDiv').css({ marginTop: '+=360px' });
  57. });
  58. /* ------ Shift input on keboard Open ------ */
  59.  
  60. });
  61.  
  62.  
  63.  
  64. function validation() {
  65.  
  66. //Que1
  67. var Q1CheckYes = document.getElementById("Check1");
  68. var Q1CheckNo = document.getElementById("Check2");
  69. var str_Q1Ans_diseaseValue = document.getElementById("textArea").value;
  70. var str_town = document.getElementById("txt_town").value;
  71. var str_pin = document.getElementById("pincode").value;
  72. var town = str_town.length;
  73. var pincode = str_pin.length;
  74. var str_annualincome = document.getElementById("annualincome").value;
  75. var chk_SSC = document.getElementById("chk1");
  76. var chk_HSC = document.getElementById("chk2");
  77. var chk_Graduate = document.getElementById("chk3");
  78. var chk_Diploma = document.getElementById("chk4");
  79. var str_txt_Others = document.getElementById("txt_Others").value;
  80. var str_nature = document.getElementById("NatureOfOccupationAndDuties").value;
  81.  
  82. Que1Final = "Empty";
  83.  
  84. //Que1
  85. if (Q1CheckYes.checked) {
  86. Que1Ans = "Yes";
  87. Que1AnsOther = "Empty";
  88.  
  89. if (str_Q1Ans_diseaseValue.length != 0) {
  90. Que1AnsOther = str_Q1Ans_diseaseValue;
  91. Que1Final = "NotEmpty";
  92. }
  93. else {
  94.  
  95. message = message + "\n Other disease field can not Empty";
  96. Que1AnsOther = "Empty";
  97. Que1Final = "Empty";
  98. }
  99.  
  100. }
  101. else {
  102. Que1AnsOther = "Empty";
  103.  
  104. }
  105.  
  106. if (Q1CheckNo.checked) {
  107. Que1Ans = "No";
  108. Que1AnsOther = "Empty";
  109. Que1Final = "NotEmpty";
  110.  
  111. }
  112.  
  113. if (!Q1CheckYes.checked && !Q1CheckNo.checked) {
  114. Que1Final = "Empty"; message = message + "\n Are you suffering from any heart disease";
  115.  
  116. }
  117.  
  118.  
  119. //Que2 Address
  120.  
  121. if (town == 0) {
  122. Que2AnsAddress = "Empty";
  123. message = message + "\n Address field can not Empty";
  124.  
  125. }
  126. else if (town > 100) {
  127. Que2AnsAddress = "Empty";
  128. message = message + "\n Address field can not be more than 100 characters";
  129.  
  130. }
  131. else {
  132. Que2AnsAddress = str_town;
  133.  
  134. }
  135.  
  136. //Que3 pincode
  137. if (str_pin == "" || isNaN(str_pin) || str_pin.length != 6) {
  138. Que3AnsPinCode = "Empty";
  139. message = message + "\n Please provide a Pincode in the format ######";
  140.  
  141. }
  142. else {
  143. Que3AnsPinCode = str_pin;
  144. }
  145.  
  146. //Que4 AnnualIncome
  147.  
  148. if (!/^[0-9]+$/.test(str_annualincome)) {
  149. Que4AnsAnnualIncome = "Empty";
  150. message = message + "\n Please enter valid Annual Income";
  151.  
  152. }
  153. else {
  154. Que4AnsAnnualIncome = str_annualincome;
  155. }
  156.  
  157. //Que5 HighestEducation
  158.  
  159.  
  160. if (chk_SSC.checked || chk_HSC.checked || chk_Graduate.checked || chk4.checked || str_txt_Others.length != 0) {
  161.  
  162. Que5Ans = "NotEmpty";
  163. Que5Ans_SSC = "Empty";
  164. Que5Ans_HSC = "Empty";
  165. Que5Ans_Graduate = "Empty";
  166. Que5Ans_Diploma = "Empty";
  167. Que5Ans_Other = "Empty";
  168. Que5Ans_Education_Other = "Empty";
  169.  
  170.  
  171. if (chk_SSC.checked) {
  172. Que5Ans_SSC = chk_SSC.value;
  173. }
  174.  
  175. if (chk_HSC.checked) {
  176. Que5Ans_HSC = chk_HSC.value;
  177. }
  178.  
  179. if (chk_Graduate.checked) {
  180. Que5Ans_Graduate = chk_Graduate.value;
  181. }
  182.  
  183. if (chk_Diploma.checked) {
  184. Que5Ans_Diploma = chk_Diploma.value;
  185. }
  186.  
  187. if (str_txt_Others.length != 0) {
  188. Que5Ans_Other = str_txt_Others;
  189. }
  190. }
  191. else {
  192. Que5Ans = "Empty";
  193. Que5Ans_SSC = "Empty";
  194. Que5Ans_HSC = "Empty";
  195. Que5Ans_Graduate = "Empty";
  196. Que5Ans_Diploma = "Empty";
  197. Que5Ans_Other = "Empty";
  198. Que5Ans_Education_Other = "Empty";
  199. message = message + "\n Please confirm highest education";
  200.  
  201. }
  202.  
  203.  
  204. //Que6 NatureOfOccupationAndDuties
  205.  
  206. if (str_nature.length == 0) {
  207. Que6AnsNatureofOccupationandDuties = "Empty";
  208. message = message + "\n Please provide Nature Of Occupation And Duties";
  209.  
  210. }
  211. else {
  212. Que6AnsNatureofOccupationandDuties = str_nature;
  213. }
  214.  
  215.  
  216.  
  217.  
  218. if (Que1Final != "Empty" && Que2AnsAddress != "Empty" && Que3AnsPinCode != "Empty" && Que4AnsAnnualIncome != "Empty" && Que6AnsNatureofOccupationandDuties != "Empty" && Que5Ans != "Empty") {
  219. location.href = '@Url.Action("btnagree", "QuestionController")?Anwer=' + Que1Ans + "##" + Que1AnsOther + "##" + Que2AnsAddress + "||" + Que3AnsPinCode + "##" + Que4AnsAnnualIncome + "##" + Que5Ans_SSC + "||" + Que5Ans_HSC + "||" + Que5Ans_Graduate + "||" + Que5Ans_Diploma + "||" + Que5Ans_Other + "##" + Que6AnsNatureofOccupationandDuties;
  220. }
  221. else {
  222. alert(message)
  223. message = "";
  224. }
  225.  
  226.  
  227. //alert(Que1Ans + " "+Que1AnsOther + " " + Que2AnsAddress + " " + Que3AnsPinCode + " " + Que4AnsAnnualIncome + " " + Que5Ans_SSC + " " + Que5Ans_HSC + " " + Que5Ans_Graduate + " " + Que5Ans_Diploma+" "+Que5Ans_Other+" "+Que5Ans_Education_Other+" "+Que6AnsNatureofOccupationandDuties)
  228. // location.href = '@Url.Action("btnagree", "QuestionController")?Anwer=' + textarea.value + "||" + str_town + "||" + annualincome + "||" + chk_SSC + "||" + chk_HSC + "||" + chk_Graduate + "||" + chk_Diploma + "||" + txt_Others + "||" + str_pin;
  229.  
  230.  
  231. } function limitText(limitField, limitNum) {
  232. if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); }
  233. }
  234.  
  235.  
  236. function selectEducation(id) {
  237.  
  238. //alert("Education box check")
  239. for (var i = 1; i <= 4; i++) {
  240. document.getElementById("chk" + i).checked = false;
  241. }
  242. document.getElementById(id).checked = true;
  243.  
  244. }
  245.  
  246.  
  247.  
  248.  
  249.  
  250. function selectOnlyThis(id) {
  251.  
  252. var textarea = $('textArea');
  253.  
  254. for (var i = 1; i <= 2; i++) {
  255. document.getElementById("Check" + i).checked = false;
  256. }
  257. document.getElementById(id).checked = true;
  258.  
  259. var value = document.getElementById(id).value;
  260. if (value == "Yes") {
  261. Que1Ans = "Yes";
  262. textarea.show();
  263. }
  264. else {
  265. Que1Ans = "No";
  266. Que1AnsOther = "Empty";
  267. textarea.hide();
  268. }
  269. } </script>
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276. </head>
  277. <body>
  278. <div class="colorBanner">
  279. <img src="Images/color-banner.jpg" class="img-responsiv floatLeft">
  280. </div>
  281. <div class="width100">
  282. <div class="heading">@Model.txtTitle </div>
  283. <div id="mainDiv" style="width: 100%; float: left; display: block;">
  284. <div class="centerDiv">
  285. <div class="policyBg width100">
  286. <div class="policyPadding">
  287. <div class="width100">
  288. @*<div class="width100 shadow-box-heading">
  289. @Model.txtHeader
  290. </div>
  291. *@
  292. </div>
  293. <div class="width100 top20">
  294. <div class="width100">@Model.txtQue1 </div>
  295. <div class="width40 top10">
  296. <input id="Check1" class="checkbox-custom" name="checkbox-2" value="Yes" type="checkbox" onclick="selectOnlyThis(this.id)"></input>
  297. <label for="Check1" class="checkbox-custom-label"></label>
  298. @Model.txtYes </div>
  299. <div class="width40 top10">
  300. <input id="Check2" class="checkbox-custom" name="checkbox-3" value="No" type="checkbox" onclick=" selectOnlyThis(this.id)"></input>
  301. <label for="Check2" class="checkbox-custom-label"></label>
  302. @Model.txtNo </div>
  303. <div class="width100 top10">
  304. <textarea id="textArea" class="inputTextarea width100" onkeydown="limitText(this,256)" onkeyup="limitText(this,256)" name="textarea" rows="3" cols="20" placeholder=" @Model.txtQue1place " style="padding: 0px;"></textarea>
  305. </div>
  306. </div>
  307. <div class="width100 top10">
  308. <div class="width100">@Model.txtQue2 </div>
  309. <div class="width50 top10">
  310. <input id="txt_town" type="text" class="inputLogin floatLeft" onkeydown="limitText(this,256)" onkeyup="limitText(this,256)" name="" placeholder="@Model.txtQue2place" style="padding: 0px; width: 95%;">
  311. </div>
  312. <div class="width50 top10">
  313. <input id="pincode" type="number" class="inputLogin floatLeft" onkeypress="if(this.value.length==6) return false;" min="0" name="" placeholder="@Model.txtQue2place2" pattern="[1-9][0-9]{5}" style="padding: 0px; width: 95%; float: right;">
  314. </div>
  315. </div>
  316. <div class="width100 top20">
  317. <div class="width100">@Model.txtQue3 </div>
  318. <div class="width100 top10">
  319. <input id="annualincome" type="number" onkeypress="if(this.value.length==15) return false;" min="0" class="inputLogin" name="" placeholder="@Model.txtQue3Place" style="padding: 0px; width: 100%;">
  320. </div>
  321. </div>
  322. <div class="width100 top10">
  323. <div class="width100 top10">@Model.txtQue4 </div>
  324. <div class="width50">
  325. <input id="chk1" class="checkbox-custom" value="SSC" name="checkbox-14" type="checkbox" onclick=" selectEducation(this.id)"></input>
  326. <label for="chk1" class="checkbox-custom-label"></label>
  327. @Model.txtSSC </div>
  328. <div class="width50">
  329. <input id="chk2" class="checkbox-custom" value="HSC" name="checkbox-15" type="checkbox" onclick=" selectEducation(this.id)"></input>
  330. <label for="chk2" class="checkbox-custom-label"></label>
  331. @Model.txtHSC </div>
  332. <div class="width50">
  333. <input id="chk3" class="checkbox-custom" value="Graduate" name="checkbox-16" type="checkbox" onclick=" selectEducation(this.id)"></input>
  334. <label for="chk3" class="checkbox-custom-label"></label>
  335. @Model.txtGraduate </div>
  336. <div class="width50">
  337. <input id="chk4" class="checkbox-custom" value="Diploma" name="checkbox-17" type="checkbox" onclick=" selectEducation(this.id)"></input>
  338. <label for="chk4" class="checkbox-custom-label"></label>
  339. @Model.txtDiploma </div>
  340. <div class="width100 top20" id="mainDiv">
  341. <div class="width100">
  342. <input id="txt_Others" type="text" class="inputLogin floatLeft" onkeydown="limitText(this,50)" onkeyup="limitText(this,50)" name="" placeholder="@Model.txtQue1place" style="padding: 0px; width: 100%;">
  343. </div>
  344. </div>
  345. </div>
  346. <div class="width100 top10">
  347. <div class="width100">@Model.txtQue6Nature </div>
  348. <div class="width100 top10">
  349. <input id="NatureOfOccupationAndDuties" type="text" onkeydown="limitText(this,256)" onkeyup="limitText(this,256)" class="inputLogin" name="" placeholder="@Model.txtQue6Place" style="padding: 0px; width: 100%;">
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. <div class="bottomBtnsContBG top10">
  357. <div class="width100">
  358. <div class="centerDiv" style="padding-bottom: 0px;">
  359. <table width="100%">
  360. <tr>
  361. <td width="15%"></td>
  362. <td width="20%" class="font16">
  363. <button id="btn_Continue" type="button" class='greenBt' onclick="validation()">@Model.txtContinue</button>
  364. </td>
  365. <td width="15%"></td>
  366. </tr>
  367. </table>
  368. </div>
  369. </div>
  370. </div>
  371. </div>
  372. <!-- <script type="text/javascript"> $(document).ready(function () { /* ------ Shift input on keboard Open ------ */ var origHeight = parseInt($(window).height()); var changeHeight, keyboardHeight; function shiftInput() { debugger; if ($(document.activeElement).attr('type') === 'text' || $(document.activeElement).attr('type') === 'tel' || $(document.activeElement).attr('type') === 'number') { // if (true) { //alert(origHeight); //$('.input-page-container>div.row').css('height', '100%'); changeHeight = parseInt($(window).height()); //alert(changeHeight); keyboardHeight = origHeight - changeHeight; //alert(keyboardHeight); var elePos = $(document.activeElement).parents().offset(); var eleTopPos = elePos.top + 60; //alert(eleTopPos); var eleBotPos = origHeight - eleTopPos; //alert(eleBotPos); if (eleBotPos <= keyboardHeight) { var toScroll = (keyboardHeight - eleBotPos) + 100; $('body').animate({ scrollTop: toScroll + 'px' }, 100); } else { //alert('outside'); } } else { // Logic for while keyboard is hidden //alert('Hi'); } } /* ------ END Shift inut on keyboard open ---- */ /* ------ Window Resize Function */ $(window).resize(function () { console.log("resize called"); //shiftInput(); }); /* ------ END Window Resize Function */ }); //window.onresize = function(event) { // console.log("resize called"); // shiftInput(); //}; </script> -->
  373.  
  374.  
  375.  
  376.  
  377.  
  378. </body>
  379.  
  380. </html>
Add Comment
Please, Sign In to add comment