By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,373 Members | 1,792 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,373 IT Pros & Developers. It's quick & easy.

when the first field value is given how to display the remaining values automaticaly

P: 8
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="datetimepicker.js">
  4. function validation() {
  5.     document.form2.flag.value="insert";
  6.     document.form2.submit();
  7. }
  8. </script>
  9. </head>
  10. <body bgcolor=#c3e393>
  11. <?php 
  12. include("dbconnection.php");
  13. $txtname=$_POST['txtname'];
  14. $txtdivision=$_POST['txtdivision'];
  15. $txtdept=$_POST['txtdept'];
  16. $txthod=$_POST['txthod'];
  17. $txtsdate=$_POST['txtsdate'];
  18. $txtfdate=$_POST['txtfdate'];
  19. $txtbudget=$_POST['txtbudget'];
  20. $txtpriority=$_POST['txtpriority'];
  21. $txtpcode=$_POST['txtpcode'];
  22. $txtsname=$_POST['txtsname'];
  23. $txtptype=$_POST['txtptype'];
  24. $txturl=$_POST['txturl'];
  25. $txtstatus=$_POST['txtstatus'];
  26. $flag=$_POST['flag'];
  27. $query=pg_query("INSERT INTO project(projname,division,department,startdate,finishdate,budget,priority,projectcode,shortname,projecttype,url,status,hod) VALUES ('$txtname','$txtdivision','$txtdept','$txtsdate','$txtfdate','$txtbudget','$txtpriority','$txtpcode','$txtsname','$txtptype','$txturl','$txtstatus','$txthod')");
  28. ?>
  29. <form name="form2" method="POST" action="project.php" >
  30. <input type="hidden" name="flag" value="<?php echo $flag; ?>">
  31. <table align=center>
  32. <h2 align=center>Project Details</h2>
  33. <tr>
  34. <td>
  35. <strong>Project code :<strong>
  36. </td>
  37. <td>
  38. <input id="pcode" type=text name="txtpcode" value="<?php echo $txtpcode; ?>"/>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td>
  43. <font size=3>
  44. <strong>Name of the Project :</strong>
  45. </td>
  46. <td>
  47. <input id="name" type=text name="txtname" value="<?php echo $txtname; ?>"/>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td>
  52. <strong>Short Name :<strong>
  53. </td>
  54. <td>
  55. <input id="sname" type=text name="txtsname" value="<?php echo $txtsname; ?>"/>
  56. </td>
  57. </tr>
  58. <tr>
  59. <td>
  60. <font size=3>
  61. <strong>Division :</strong>
  62. </td>
  63. <td>
  64. <input id="division" type=text name="txtdivision" value="<?php echo $txtdivision; ?>"/>
  65. </td>
  66. </tr>
  67. <tr>
  68. <td>
  69. <font size=3>
  70. <strong>Department :</strong>
  71. </td>
  72. <td>
  73. <input id="dept" type=text name="txtdept" value="<?php echo $txtdept; ?>"/>
  74. </td>
  75. </tr>
  76. <tr>
  77. <td>
  78. <font size=3>
  79. <strong>Department HOD :</strong>
  80. </td>
  81. <td>
  82. <input id="hod" type=text name="txthod" value="<?php echo $txthod; ?>"/>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td>
  87. <font size=3>
  88. <strong>Start Date :</strong>
  89. </td>
  90. <td>
  91. <input id="demo1" type="text" name="txtsdate" value="<?php echo $txtsdate; ?>"><a href="javascript:NewCal('demo1','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
  92. </td>
  93. </tr>
  94. <tr>
  95. <td>
  96. <strong>Target Finish Date :<strong>
  97. </td>
  98. <td>
  99. <input id="demo2" type="text" name="txtfdate" value="<?php echo $txtfdate; ?>"><a href="javascript:NewCal('demo2','ddmmyyyy')"><img src="cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
  100. </td>
  101. </tr>
  102.  
  103.  
  104. <tr>
  105. <td>
  106. <strong>Budget :<strong>
  107. </td>
  108. <td>
  109. <input type="checkbox" name="txtbudget" value="y" /> yes
  110. <input type="checkbox" name="txtbudget" value="n" /> no
  111. </td>
  112. </tr>
  113.  
  114.  
  115. <tr>
  116. <td>
  117. <strong>Priority :<strong>
  118. </td>
  119. <td>
  120. <select name="txtpriority">
  121. <option value="1">Low</option>
  122. <option value="2">Medium</option>
  123. <option value="3">High</option>
  124. </select></div>
  125. </td>
  126. </tr>
  127. <tr>
  128. <td>
  129. <strong>Project Type :<strong>
  130. </td>
  131. <td>
  132. <input id="ptype" type=text name="txtptype" value="<?php echo $txtptype; ?>"/>
  133. </td>
  134. </tr>
  135.  
  136. <tr>
  137. <td>
  138. <strong>URL of the project :<strong>
  139. </td>
  140. <td>
  141. <input id="url" type=text name="txturl" value="<?php echo $txturl; ?>"/>
  142. </td>
  143. </tr>
  144.  
  145. <tr>
  146. <td>
  147. <strong>Status :<strong>
  148. </td>
  149. <td>
  150. <select name="txtstatus">
  151. <option value="1">initialization</option>
  152. <option value="2">Study</option>
  153. <option value="3">SRS</option>
  154. <option value="4">Design</option>
  155. <option value="5">Coding</option>
  156. <option value="6">Testing</option>
  157. <option value="7">Implementation</option>
  158. </select>
  159. </td>
  160. </tr>
  161. </table>
  162. <center>
  163. <table>
  164. <tr>
  165. <td><input type=button value="Submit" name="b1" onClick="return validation()";/></td>
  166. <td><input type="Reset" name="b2"></td>
  167. </tr>
  168. </table>
  169. </center>
  170. </form>
  171. </body>
  172. </html>
Apr 23 '12 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,059
code dump, you expect people to read this ****
Apr 23 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.