At the moment all the fields (apart from date) have to be inputted manually.
I would like to be able to have a number of the fields as selection drop down boxes, populated from seperate tables in the database. This will aid the user and provide uniform data that can easily be analysed.
I have spent days trying to find the exact code to perform this task, so would be grateful if somebody has an answer for me.
Here is the code so far, (the fields I wish to have as drop down boxes are Model, Repair Carried Out & Work Source:
Expand|Select|Wrap|Line Numbers
- <head>
- <script type="text/javascript" src="js/jquery.js" /></script>
- <script type="text/javascript" src="js/jquery-ui.js" /></script>
- <script type="text/javascript" src="js/lisa.js" /></script>
- <link href="css/jquery.css" media="screen" rel="stylesheet" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Untitled Document</title>
- <style type="text/css">
- <!--
- body {
- margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
- padding: 0;
- text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
- color: #000000;
- font-family: Arial, Helvetica, sans-serif;
- font-size: 100%;
- background-color: #FFF;
- }
- .oneColFixCtrHdr #container {
- width: 780px; /* using 20px less than a full 800px width allows for browser chrome and avoids a horizontal scroll bar */
- background: #FFFFFF;
- margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
- border: 1px solid #000000;
- text-align: left; /* this overrides the text-align: center on the body element. */
- }
- .oneColFixCtrHdr #header {
- padding: 0 10px 0 20px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
- background-color: #FFF;
- }
- .oneColFixCtrHdr #header h1 {
- margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
- padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
- }
- .oneColFixCtrHdr #mainContent {
- padding: 0 20px; /* remember that padding is the space inside the div box and margin is the space outside the div box */
- background: #FFFFFF;
- text-align: right;
- }
- .oneColFixCtrHdr #footer {
- padding: 0 10px;
- background-color: #FFF;
- }
- .oneColFixCtrHdr #footer p {
- margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
- padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
- }
- -->
- </style>
- </head>
- <body class="oneColFixCtrHdr">
- <div id="container">
- <div id="header">
- <h1>Header</h1>
- <!-- end #header --></div>
- <div id="mainContent">
- <form method="POST" action="download_pdf.php" name="input" onSubmit="return validate()">
- <table width="70%" border="0" align="center">
- <tr>
- <td>Owners Name</td>
- <td><input type="text" name="Owners_Name" /></td>
- </tr>
- <tr>
- <td>Model </td>
- <td><input type="text" name="Model" /></td>
- </tr>
- <tr>
- <td>Reg No. </td>
- <td><input type="text" name="Reg_No" /></td>
- </tr>
- <tr>
- <td>Mileage </td>
- <td><input type="text" name="Mileage" /></td>
- </tr>
- <tr>
- <td>Repairs Carried Out </td>
- <td><input type="text" name="Repairs_Carried_Out" /></td>
- </tr>
- <tr>
- <td>Repair Date </td>
- <td><input type="text" name="Repair_Date" id="Repair_Date" /></td>
- </tr>
- <tr>
- <td>Invoice Number </td>
- <td><input type="text" name="Invoice_Number" /></td>
- </tr>
- <tr>
- <td>VIN (17 digits)</td>
- <td><input type="text" name="VIN" /></td>
- </tr>
- <tr>
- <td>Total Repair Cost </td>
- <td><input type="text" name="Total_Repair_Cost" /></td>
- </tr>
- <tr>
- <td>Paint Cost </td>
- <td><input type="text" name="Paint_Cost" /></td>
- </tr>
- <tr>
- <td>Labour Cost </td>
- <td><input type="text" name="Labour_Cost" /></td>
- </tr>
- <tr>
- <td>Parts Cost </td>
- <td><input type="text" name="Parts_Cost" /></td>
- </tr>
- <tr>
- <td>Work Source </td>
- <td><input type="text" name="Work_Source" /></td>
- </tr>
- </table>
- <br/>
- <br/>
- <input type="submit" value="Save" /></form>
- <!-- end #mainContent --></div>
- <div id="footer">
- <p>Footer</p>
- <!-- end #footer --></div>
- <!-- end #container --></div>
- </body>
- </html>