Guest User

Untitled

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