Javascript mysql interface?

goldenyflame

New Member
I am going back though a web-based document numbering system from few weeks ago. To sum it up, the user types in the project,class,base, and dash number (PPP-CCC-BBBB-DDD) then it is added to a mysql database. Now most doc numbers go in order according to revisions. IE: A document 1465-630-0001-000 becomes, after revision, 1465-630-0002-000. The boss wants the system to automatically fill the input text box for the base number if it detects that the user is entering a revised doc. So if a user types in 1465 into the project field and 630 into the class field the system should autofill the base field with the next available number. In the previous example this would be 0002. It needs to be able to search the database for the first two fields so that it can find the next available one. Is there anyway to do this using javascript or something? SO was really helpful with my last javascript question pertaining to this system.heres an bit of my code if it helps:` ?>\[code\]<div id='preview'></div><form id='item' action="submit.php?item=1" method="post">Enter Title:<input type="text" name="title" size="20"><BR>Choose Project Code:<SELECT NAME="project"> <OPTION VALUE="">Project... <? $query = "SELECT * FROM project ORDER BY project asc"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $num = ($row['project']); $name = ($row['description']); ?> <OPTION VALUE="http://stackoverflow.com/questions/3841915/<?=$num?>" ><? echo"{$num}" . " | " . "{$name}";?> <? } ?> </SELECT><BR>Choose Class Code:<SELECT NAME="class"> <OPTION VALUE="">Class... <? $query = "SELECT * FROM class ORDER BY class asc"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $num = ($row['class']); $name = ($row['description']); ?> <OPTION VALUE="http://stackoverflow.com/questions/3841915/<?=$num?>" ><? echo"{$num}" . " | " . "{$name}";?> <? } ?> </SELECT><BR>Assigned Base Number:<input type="text" name="base" size="20"><BR>Enter Dash Number:<input type="text" name="dash" size="20"><BR>Enter Comments:<input type="text" name="comment" size="40"><BR><input type="hidden" name="item" value="http://stackoverflow.com/questions/3841915/1"/> `\[/code\]Just a simple html/php input form with the project and class code list generated from a database pertaining to each.Thanks for any help-Thomas
 
Back
Top