Guest User

Untitled

a guest
Nov 29th, 2018
254
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript">
  2. function tanya()
  3. {
  4. if(confirm('Are You Sure To Continue ?'))
  5. {
  6. return true;
  7. }
  8. else
  9. {
  10. return false;
  11. }
  12. }
  13. </script>
  14. function validasi ()
  15. {
  16. //validasi inputan text nama
  17. var air_cd= document.form2.air_cd.value;
  18. if(air_cd==""){
  19. alert("AIRLINE NAME MAY NOT EMPTY");
  20. document.form2.air_cd.focus();
  21. return false;
  22. }
  23. }
  24. </script>
  25.  
  26. </head>
  27.  
  28. <body>
  29. <script>
  30. var thoudelim = "";
  31. var decdelim = "";
  32. var curr = "";
  33. var d=document;
  34.  
  35. function haltnondigit(e) {
  36.  
  37. var
  38. allowkey=Array(48,49,50,51,52,53,54,55,56,57,8,9,188,190,45,46,13,33,34,35,36,37,38,39,40,112,113,114,115,116,117,118,119,120,121,123,96,97,98,99,100,101,102,103,104,105,110);
  39. if(allowkey.indexOf(e.keyCode)==-1) return false;
  40. return true;
  41. }
  42. function format(s) {
  43.  
  44. var s1 = s.substring(0, 3);
  45. var s2 = s.substring(3, 7);
  46. var s3 = s.substring(7, 11);
  47. s = s1+"-"+s2+" "+s3;
  48. return s;
  49. }
  50.  
  51. function display(t,i) {
  52. t.value=(t.value);
  53. d.getElementById("awb_no"+i).value=t.value;
  54. t.value=format(t.value);
  55. console.log(t.value);
  56. if(t.value.length<13){
  57. alert('blablabla');
  58. t.focus();
  59. }
  60.  
  61. }
  62.  
  63. function edit(t,i) { t.value=d.getElementById("awb_no"+i).value; }
  64.  
  65. </script>
  66.  
  67.  
  68. <form id="form1" name="form1" method="post" action="">
  69. <label for="jum">Stock AWB </label>
  70. <input name="jum" type="text" id="jum" size="2" maxlength="2" />
  71. <input type="submit" name="insert" id="insert" value="insert" />
  72. </form>
  73. <p>ENTRY STOCK AWB </p>
  74. <form id="form2" name="form2" method="post" action="" onSubmit="return validasi()" >
  75. <table width="338" border="1" cellspacing="0" cellpadding="0">
  76. <tr>
  77. <td width="87">Date</td>
  78. <td width="245"><label for="tglbook"></label>
  79. <input type='text' name="tglbook" id="tglbook" value="<?php echo $tanggal; ?>" size="10" maxlength="10" readonly="readonly" />
  80. <link type="text/css" href="../js/themes/base/ui.all.css" rel="stylesheet" />
  81. <script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
  82. <script type="text/javascript" src="../js/ui.core.js"></script>
  83. <script type="text/javascript" src="../js/ui.datepicker.js"></script>
  84. <script type="text/javascript">
  85. $(document).ready(function(){
  86. $("#tglbook").datepicker({
  87. dateFormat : "yy-mm-dd",
  88. changeMonth : true,
  89. changeYear : true
  90.  
  91. });
  92. });
  93.  
  94. </script>
  95.  
  96. </td>
  97. </tr>
  98. <tr>
  99. <td width="87">Airline</td>
  100. <td width="245"><label for="air_cd"></label>
  101. <input name="air_cd" type='text' id="air_cd" size="3" maxlength="3" readonly="readonly" />
  102. <input name="help" type="button" id="help" onclick="MM_openBrWindow('window/w airline awb.php','','scrollbars=yes,width=500,height=400')" value="Help" /></td>
  103. </tr>
  104. <tr>
  105. <td>Airline Name</td>
  106. <td><label for="air_name"></label>
  107. <input name="air_name" type="text" id="air_name" readonly="readonly" /></td>
  108. </tr>
  109. <tr>
  110. <td width="87">NO</td>
  111. <td width="245">AWB NO</td>
  112. </tr>
  113. <?php
  114. $n = $_POST['jum'];
  115. for ($i=1; $i<=$n; $i++)
  116. {
  117. echo "
  118. <tr>
  119. <td>".$i."</td>
  120. <td><label for='awb_no'></label>
  121. <input type='text' size='13' maxlength='13' value=''
  122. onblur='display(this,".$i.");'
  123. onfocus='edit(this,".$i.")'
  124. onkeydown='return haltnondigit(event)' />
  125. <input type='hidden' name='awb_no".$i."' id='awb_no".$i."' value='' size='13' maxlength='13'
  126. /></td>
  127. </tr>";
  128. }
  129. ?>
  130. <tr>
  131. <td colspan="2"> <p align="center">
  132. <input type="submit" name="submit" id="submit" onclick="return tanya()" value="POSTING" />
  133. <input type="reset" name="reset" id="reset" value="RESET" />
  134. </p></td>
  135. </tr>
  136.  
  137. </table>
  138. <p>&nbsp;</p>
  139. <input type="hidden" name="jum" value="<?php echo $n; ?>">
  140. <input type="hidden" name="MM_insert" value="form2" />
  141. </form>
RAW Paste Data