Jump to content

fill the field and the next combo box fills its value automatically from the database


vellaraviteja
 Share

Recommended Posts

<html><head><script type="text/javascript" src="datetimepicker.js"></script></head><body bgcolor=#c3e393><?php include("dbconnection.php");$txtname=$_POST['txtname'];$txtdivision=$_POST['txtdivision'];$txtdept=$_POST['txtdept'];$txthod=$_POST['txthod'];$txtsdate=$_POST['txtsdate'];$txtfdate=$_POST['txtfdate'];$txtbudget=$_POST['txtbudget'];$txtpriority=$_POST['txtpriority'];$txtpcode=$_POST['txtpcode'];$txtsname=$_POST['txtsname'];$txtptype=$_POST['txtptype'];$txturl=$_POST['txturl'];$txtstatus=$_POST['txtstatus'];$flag=$_POST['flag'];$query=pg_query("INSERT INTO project1 VALUES ('$txtpcode','$txtname','$txtsname','$txtdivision','$txtdept','$txthod','$txtsdate','$txtfdate','$txtbudget','$txtpriority','$txtp type','$txturl','$txtstatus')");$rav=pg_query("SELECT division from project1 where .........);?><form name="form2" method="POST" action="project.php" ><input type="hidden" name="flag" value="<?php echo $flag; ?>"><table align=center><h2 align=center>Project Details</h2><tr><td><strong>Project code :<strong></td><td><input id="pcode" type=text name="txtpcode" value="<?php echo $txtpcode; ?>"/></td></tr><tr><td><font size=3><strong>Name of the Project :</strong></td><td><input id="name" type=text name="txtname" value="<?php echo $txtname; ?>"/></td></tr><tr><td><strong>Short Name :<strong></td><td><input id="sname" type=text name="txtsname" value="<?php echo $txtsname; ?>"/></td></tr><tr><td><font size=3><strong>Division :</strong></td><td><select name="txtdivision" value="<?php echo $txtdivision; ?>"><option value="y"><?php echo $rav; ?></option></td></tr><tr><td><font size=3><strong>Department :</strong></td><td><input id="dept" type=text name="txtdept" value="<?php echo $txtdept; ?>"/></td></tr><tr><td><font size=3><strong>Department HOD :</strong></td><td><input id="hod" type=text name="txthod" value="<?php echo $txthod; ?>"/></td></tr><tr><td><font size=3><strong>Start Date :</strong></td><td><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></td></tr><tr><td><strong>Target Finish Date :<strong></td><td><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></td></tr> <tr><td><strong>Budget :<strong></td><td><select name="txtbudget" value="<?php echo $txtbudget; ?>"><option value="y">yes</option><option value="n">no</option></select></td></tr> <tr><td><strong>Priority :<strong></td><td><select name="txtpriority" value="<?php echo $txtpriority; ?>"><option value="1">Low</option><option value="2">Medium</option><option value="3">High</option></select></div></td></tr><tr><td><strong>Project Type :<strong></td><td><input id="ptype" type=text name="txtptype" value="<?php echo $txtptype; ?>"/></td></tr> <tr><td><strong>URL of the project :<strong></td><td><input id="url" type=text name="txturl" value="<?php echo $txturl; ?>"/></td></tr> <tr><td><strong>Status :<strong></td><td><select name="txtstatus" value="<?php echo $txtstatus; ?>"><option value="1">initialization</option><option value="2">Study</option><option value="3">SRS</option><option value="4">Design</option><option value="5">Coding</option><option value="6">Testing</option><option value="7">Implementation</option></select></td></tr></table><center><table><tr><td><input type=button value="Submit" name="b1" onClick="return validation()";/></td><td><input type="Reset" name="b2"></td></tr></table></center></form></body></html>

Link to comment
Share on other sites

what were you expecting? what is not working? what is happening instead?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...