473,573 Members | 2,835 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using JavaScript validation with php

maxamis4
295 Recognized Expert Contributor
I currently have an input form in HTML. I am trying to use JavaScript to validate that the html forms are entered. I had it working earlier today but now my form is not validating. Could someone take a look and tell me why its not working.

php html page
Expand|Select|Wrap|Line Numbers
  1.  
  2. <?php
  3.     require_once('auth.php');
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  9. <link href="loginmodule.css" rel="stylesheet" type="text/css" />
  10.     <TITLE>Significant Activities</TITLE>
  11. <SCRIPT LANGUAGE="JavaScript" SRC="scripts/reportlbr.js"></SCRIPT>
  12. <style type="text/css">
  13.     <!--
  14.     .style1 
  15.     {
  16.         font-size: 10px;
  17.         font-style: italic;
  18.         font-weight: bold;
  19.     }
  20.     .style2 {font-size: 9px}
  21.     .style4 {font-size: 12px}
  22.     .style6 {font-size: 12px; font-weight: bold; }
  23.     --> 
  24. </style>
  25.  
  26.  
  27. </HEAD>
  28. <BODY>
  29.  
  30. <?php
  31.     //Include database connection details
  32.     require_once('configrisks.php');
  33.  
  34.     //Array to store validation errors
  35.     $errmsg_arr = array();
  36.  
  37.     //Validation error flag
  38.     $errflag = false;
  39.  
  40.     //Connect to mysql server
  41.     $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  42.     if(!$link) {
  43.         die('Failed to connect to server: ' . mysql_error());
  44.     }
  45.  
  46.     //Select database
  47.     $db = mysql_select_db(DB_DATABASE);
  48.     if(!$db) {
  49.         die("Unable to select database");
  50.     }
  51.  
  52.     //Function to sanitize values received from the form. Prevents SQL injection
  53.     function clean($str) {
  54.         $str = @trim($str);
  55.         if(get_magic_quotes_gpc()) {
  56.             $str = stripslashes($str);
  57.         }
  58.         return mysql_real_escape_string($str);
  59.     }
  60.  
  61.  
  62.  
  63.     //************************************************************************************
  64.     //                                        BUILD ARRAYS
  65.     //====================================================================================
  66.  
  67.     //================================ARRAY 1=====================================
  68.  
  69.         //CREATE DROP DOWNS FOR FORM USAGE
  70.     $sql = "SELECT proj_sym, proj_description FROM tbl_project_type WHERE proj_code = 'risk' AND proj_active = 1";
  71.     $proj = mysql_query($sql);
  72.     if($proj) 
  73.     {
  74.         $proj_num = mysql_num_rows($proj);
  75.  
  76.  
  77.         //Loop through data array
  78.         while($row=mysql_fetch_assoc($proj))
  79.         {
  80.             $proj_array_sym[]=$row["proj_sym"];
  81.             $proj_array_description[]=$row["proj_description"];
  82.         };
  83.  
  84.     }
  85.     else
  86.     {
  87.  
  88.         echo "Array1";
  89.         die('Error reading user data');
  90.  
  91.     }
  92.  
  93.  
  94.     //============================= ARRAY 1 END ================================
  95.  
  96.  
  97.  
  98.     //================================ARRAY 2===================================
  99.  
  100.     //CREATE DROP DOWNS FOR FORM USAGE
  101.     $sql = "SELECT cat_uuid, cat_code FROM tbl_cat WHERE cat_proj_code = 'risk' AND active = 1";
  102.     $cat = mysql_query($sql);
  103.     if($cat) 
  104.     {
  105.         $cat_num = mysql_num_rows($cat);
  106.  
  107.         //Loop through data array
  108.         while($row=mysql_fetch_assoc($cat))
  109.         {
  110.             $cat_array_uuid[]=$row["cat_uuid"];
  111.             $cat_array_code[]=$row["cat_code"];
  112.         };
  113.  
  114.     }
  115.     else
  116.     {
  117.  
  118.         echo "Array2";
  119.         die('Error reading user data');
  120.     }
  121.  
  122.     //============================END ARRAY 2===================================
  123.  
  124.  
  125.     //================================ARRAY 3===================================
  126.         //CREATE DROP DOWNS FOR FORM USAGE
  127.     $sql = "SELECT code, des FROM tbl_department WHERE proj_code = 'risk' AND active = 1";
  128.     $dep = mysql_query($sql);
  129.     if($dep) 
  130.     {
  131.         $dep_num = mysql_num_rows($dep);
  132.  
  133.  
  134.         //Loop through data array
  135.         while($row=mysql_fetch_assoc($dep))
  136.         {
  137.             $dep_array_code[]=$row["code"];
  138.             $dep_array_des[]=$row["des"];
  139.         };
  140.  
  141.     }
  142.     else
  143.     {
  144.  
  145.         echo "Array3";
  146.         die('Error reading user data');
  147.     }
  148.  
  149.     //================================ARRAY 4===================================
  150.     //CREATE DROP DOWNS FOR FORM USAGE
  151.     $sql = "SELECT id, realname, firstname FROM tbl_users WHERE active = 1 ORDER BY realname;";
  152.     $user = mysql_query($sql);
  153.     if($dep) 
  154.     {
  155.         $user_num = mysql_num_rows($user);
  156.  
  157.  
  158.         //Loop through data array
  159.         while($row=mysql_fetch_assoc($user))
  160.         {
  161.             $user_array_id[]=$row["id"];
  162.             $user_array_last[]=$row["realname"];
  163.             $user_array_first[]=$row["firstname"];
  164.  
  165.         };
  166.  
  167.     }
  168.     else
  169.     {
  170.  
  171.         echo "Array4";
  172.         die('Error reading user data');
  173.     }
  174.  
  175.  
  176.  
  177.  
  178.     //============================END ARRAY 3===================================
  179.  
  180.  
  181. ?>
  182.  
  183. <FORM NAME="blank_risk_form" id="blank_risk_form" method="post" action="submitnewrisk.php" onsubmit="return validate_form(this)">
  184.   <font face="Arial, Helvetica, sans-serif"><center>
  185.   <th colspan=3><center><h1>Risk Identification Form</h1>
  186.   <p align="left">
  187.     <input type="text" name="user" value="<?php echo $_SESSION['SESS_FIRST_NAME']; echo ' '; echo $_SESSION['SESS_LAST_NAME']; ?>" />
  188.   </p>
  189.   <p align="left">
  190.     <input type="text" name="currentdate" value="<?php $cdate=date('Y-m-d'); echo $cdate; ?>" />
  191. </p>
  192.   <p align="left">Originated By
  193.     <?php 
  194.                     echo $_SESSION['SESS_FIRST_NAME']; 
  195.                     echo ' '; 
  196.                     echo $_SESSION['SESS_LAST_NAME']; 
  197.                 ?>
  198. </p>
  199.   <p align="left"><span class="style4">Date Submitted:
  200.       <?php 
  201.                     $cdate=date("Y-m-d"); 
  202.                     echo $cdate; 
  203.                 ?>
  204.   </span></p>
  205.   <p align="left"><span class="style2"><span class="style4">Subtask Owner: </span> </span>
  206.     <select name="cbo_subtsk" id="select2" >
  207.                   <?php
  208.                     //BUILD DROP DOWN LIST
  209.  
  210.                     //FOR STATEMENT 1 START
  211.                         echo '<option value=""></option>';
  212.                         for ($array_1index=0; $array_1index < $dep_num; $array_1index += 1) 
  213.                         {
  214.  
  215.                                 echo '<option value='; 
  216.                                 echo $dep_array_code[$array_1index];
  217.                                 echo '>'; 
  218.                                 echo $dep_array_des[$array_1index]; 
  219.                                 echo '</option>';
  220.  
  221.                         }//FOR STATEMENT 1 END
  222.  
  223.                     ?>
  224.     </select>
  225. </p>
  226.   <p align="left"><span class="style2"><span class="style4">Risk Category:
  227.         <select name="cbo_risk_cat" id="select3">
  228.           <?php
  229.                     //BUILD DROP DOWN LIST
  230.  
  231.                     //FOR STATEMENT 2 START
  232.                         echo '<option value=""></option>';
  233.                         for ($array_1index=0; $array_1index < $cat_num; $array_1index += 1) 
  234.                         {
  235.  
  236.                                 echo '<option value='; 
  237.                                 echo $cat_array_uuid[$array_1index];
  238.                                 echo '>'; 
  239.                                 echo $cat_array_code[$array_1index]; 
  240.                                 echo '</option>';
  241.  
  242.                         }//FOR STATEMENT 2 END
  243.  
  244.                     ?>
  245.         </select>
  246. </span></span></p>
  247.   <p align="left"><span class="style4">Type of Risk: </span>
  248.     <select name="cbo_risk_type" id="select4" >
  249.       <?php
  250.                     //BUILD DROP DOWN LIST
  251.  
  252.                     //FOR STATEMENT 1 START
  253.                     echo '<option value=""></option>';
  254.                         for ($array_1index=0; $array_1index < $proj_num; $array_1index += 1) 
  255.                         {
  256.  
  257.                                 echo '<option value='; 
  258.                                 echo $proj_array_sym[$array_1index];
  259.                                 echo '>'; 
  260.                                 echo $proj_array_description[$array_1index]; 
  261.                                 echo '</option>';
  262.  
  263.                         }//FOR STATEMENT 1 END
  264.  
  265.                     ?>
  266.     </select> 
  267.   </p>
  268.   <p align="left"><span class="style4">Owner:
  269.       <select name="cbo_owner" id="select5" >
  270.         <?php
  271.                     //BUILD DROP DOWN LIST
  272.  
  273.                     //FOR STATEMENT 1 START
  274.                     echo '<option value=""></option>';
  275.                         for ($array_1index=0; $array_1index < $user_num; $array_1index += 1) 
  276.                         {
  277.  
  278.                                 echo '<option value='; 
  279.                                 echo $user_array_id[$array_1index];
  280.                                 echo '>'; 
  281.                                 echo $user_array_last[$array_1index];
  282.                                 echo ", ";
  283.                                 echo $user_array_first[$array_1index];
  284.                                 echo '</option>';
  285.  
  286.                         }//FOR STATEMENT 1 END
  287.  
  288.                     ?>
  289.       </select>
  290. </span></p>
  291.   <p align="left"><span class="style4">Please describe your risk:</span> <br />
  292.     <textarea name="txt_req_des" cols="75" rows="5" id="textarea2"></textarea>
  293. </p>
  294.   <table width="969" border="0" cellpadding="0" cellspacing="1">
  295.     <tr bordercolor="#999999">
  296.       <th colspan="8" scope="col"><div align="left">PROBABILITY OF OCCURENCE<br />
  297.               <span class="style4"><em>(Select one frome each group) </em></span></div></th>
  298.     </tr>
  299.     <tr>
  300.       <td width="20">&nbsp;</td>
  301.       <td width="226" bordercolor="#999999" bgcolor="#999999"><div align="center"><span class="style4"><strong>RESOURCES</strong></span></div></td>
  302.       <td width="20">&nbsp;</td>
  303.       <td width="240" bgcolor="#999999"><div align="center"><span class="style4">REQUIREMENTS</span></div></td>
  304.       <td width="20">&nbsp;</td>
  305.       <td width="219" bgcolor="#999999"><div align="center"><span class="style4">TECHNOLOGY</span></div></td>
  306.       <td width="20">&nbsp;</td>
  307.       <td width="239" bgcolor="#999999"><div align="center"><span class="style4"><strong>HARDWARE</strong></span></div></td>
  308.     </tr>
  309.     <tr>
  310.       <td bgcolor="#FFCC66"><input name="res" type="radio" value=".09" /></td>
  311.       <td bgcolor="#FFCC66"><span class="style4"> Not available and good probability of significant deficiencies in meeting skill needs. </span></td>
  312.       <td><input name="req" type="radio" value=".09" /></td>
  313.       <td><span class="style4"> Good probability of significant deficiencies in meeting requirements. </span></td>
  314.       <td><input name="tech" type="radio" value=".09" /></td>
  315.       <td><span class="style4"> Maximum technology/maximum capability. </span></td>
  316.       <td><input name="hard" type="radio" value=".09" /></td>
  317.       <td><span class="style4"> Theoretical design based on advanced research. </span></td>
  318.     </tr>
  319.     <tr>
  320.       <td><input name="res" type="radio" value=".08" /></td>
  321.       <td><span class="style4">Not readily available and good probability of some moderate deficiencies in meeting skill needs. </span></td>
  322.       <td bgcolor="#CCFF66"><input name="req" type="radio" value=".08" /></td>
  323.       <td bgcolor="#CCFF66"><span class="style4"> Good probability of some moderate deficiencies in meeting all requirements. </span></td>
  324.       <td bgcolor="#CCFF66"><input name="tech" type="radio" value=".08" /></td>
  325.       <td bgcolor="#CCFF66"><span class="style4"> Theoretical technology. </span></td>
  326.       <td bgcolor="#CCFF66"><input name="hard" type="radio" value=".08" /></td>
  327.       <td bgcolor="#CCFF66"><span class="style4"> New theoretical design. </span></td>
  328.     </tr>
  329.     <tr>
  330.       <td bgcolor="#FFCC66"><input name="res" type="radio" value=".07" /></td>
  331.       <td bgcolor="#FFCC66"><span class="style4">Not readily available and moderate chance of moderate deficiencies in meeting skill needs. </span></td>
  332.       <td><input name="req" type="radio" value=".07" /></td>
  333.       <td><span class="style4"> Moderate chance of moderate deficiencies in meeting all requirements. </span></td>
  334.       <td><input name="tech" type="radio" value=".07" /></td>
  335.       <td><span class="style4"> Newer technology. </span></td>
  336.       <td><input name="hard" type="radio" value=".07" /></td>
  337.       <td><span class="style4"> All new design. </span></td>
  338.     </tr>
  339.     <tr>
  340.       <td rowspan="2"><input name="res" type="radio" value=".06" /></td>
  341.       <td rowspan="2"><span class="style4">Not readily available and moderate chance of moderate deficiencies in meeting skill needs. </span><span class="style4"> </span></td>
  342.       <td bgcolor="#CCFF66"><input name="req" type="radio" value=".06" /></td>
  343.       <td bgcolor="#CCFF66"><span class="style4"> Moderate chance of minor requirement deficiencies. </span></td>
  344.       <td bgcolor="#CCFF66"><input name="tech" type="radio" value=".06" /></td>
  345.       <td bgcolor="#CCFF66"><span class="style4"> Available technology. Feasible by analogy. </span></td>
  346.       <td bgcolor="#CCFF66"><input name="hard" type="radio" value=".06" /></td>
  347.       <td bgcolor="#CCFF66"><span class="style4"> New design to moderately improve existing design. </span></td>
  348.     </tr>
  349.     <tr>
  350.       <td><input name="req" type="radio" value=".05" /></td>
  351.       <td><span class="style4"> Some chance of minor requirement deficiencies. </span></td>
  352.       <td><input name="tech" type="radio" value=".05" /></td>
  353.       <td><span class="style4"> Existing technology and feasibility studies. </span></td>
  354.       <td><input name="hard" type="radio" value=".05" /></td>
  355.       <td><span class="style4"> Major design change. </span></td>
  356.     </tr>
  357.     <tr>
  358.       <td rowspan="2" bgcolor="#FFCC66"><input name="res" type="radio" value=".04" /></td>
  359.       <td rowspan="2" bgcolor="#FFCC66"><span class="style4"> Available and some chance of minor deficiencies in meeting skill needs. </span><span class="style4"> </span></td>
  360.       <td bgcolor="#CCFF66"><input name="req" type="radio" value=".04" /></td>
  361.       <td bgcolor="#CCFF66"><span class="style4"> Slight chance of minor requirement deficiencies. </span></td>
  362.       <td bgcolor="#CCFF66"><input name="tech" type="radio" value=".04" /></td>
  363.       <td bgcolor="#CCFF66"><span class="style4"> Proven technology and approach. </span></td>
  364.       <td bgcolor="#CCFF66"><input name="hard" type="radio" value=".04" /></td>
  365.       <td bgcolor="#CCFF66"><span class="style4"> Redesign, significant modifications. </span></td>
  366.     </tr>
  367.     <tr>
  368.       <td><input name="req" type="radio" value=".03" /></td>
  369.       <td><span class="style4"> Should meet all requirements with little margin. </span></td>
  370.       <td><input name="tech" type="radio" value=".03" /></td>
  371.       <td><span class="style4"> Proven technology and approach, used by some design agent. </span></td>
  372.       <td><input name="hard" type="radio" value=".03" /></td>
  373.       <td><span class="style4"> Existing proven components, recombined or minor mods in function. </span></td>
  374.     </tr>
  375.     <tr>
  376.       <td><input name="res" type="radio" value=".02" /></td>
  377.       <td><span class="style4"> Available and should meet all skill needs with little margin. </span></td>
  378.       <td bgcolor="#CCFF66"><input name="req" type="radio" value=".02" /></td>
  379.       <td bgcolor="#CCFF66"><span class="style4"> Should meet all requirements, and exceed many. </span></td>
  380.       <td bgcolor="#CCFF66"><input name="tech" type="radio" value=".02" /></td>
  381.       <td bgcolor="#CCFF66"><span class="style4"> Proven technology and approach with significant design agent experience. </span></td>
  382.       <td bgcolor="#CCFF66"><input name="hard" type="radio" value=".02" /></td>
  383.       <td bgcolor="#CCFF66"><span class="style4"> Existing proven components, repackaged and/or minor usage variation. </span></td>
  384.     </tr>
  385.     <tr>
  386.       <td height="47" bgcolor="#FFCC66"><input name="res" type="radio" value=".01" /></td>
  387.       <td bgcolor="#FFCC66"><span class="style4"> Available and should meet all skill needs, and exceed many. </span></td>
  388.       <td><input name="req" type="radio" value=".01" /></td>
  389.       <td><span class="style4"> Will meet all requirements, exceeding many. </span></td>
  390.       <td><input name="tech" type="radio" value=".01" /></td>
  391.       <td><span class="style4"> Proven technology and approach with significant design agent experience. </span></td>
  392.       <td><input name="hard" type="radio" value=".01" /></td>
  393.       <td><span class="style4"> Functional hardware only. Mods in form only. </span></td>
  394.     </tr>
  395.     <tr>
  396.       <td><input name="res" type="radio" value=".001" /></td>
  397.       <td><span class="style4"> Available and will meet and exceed all skill needs. </span></td>
  398.       <td bgcolor="#CCFF66"><input name="req" type="radio" value="0.001" /></td>
  399.       <td bgcolor="#CCFF66"><span class="style4"> Will exceed all requirements with margin. </span></td>
  400.       <td bgcolor="#CCFF66"><input name="tech" type="radio" value="0.001" /></td>
  401.       <td bgcolor="#CCFF66"><span class="style4"> Off-the-shelf technology proven to operational environments. </span></td>
  402.       <td bgcolor="#CCFF66"><input name="hard" type="radio" value="0.001" /></td>
  403.       <td bgcolor="#CCFF66"><span class="style4"> Functional hardware. </span></td>
  404.     </tr>
  405.     <tr>
  406.       <td bgcolor="#FFCC66"><input name="res" type="radio" value=" 0" checked="checked" /></td>
  407.       <td bgcolor="#FFCC66"><span class="style4">None</span></td>
  408.       <td><input name="req" type="radio" value=" 0" checked="checked" /></td>
  409.       <td><span class="style4">None</span></td>
  410.       <td><input name="tech" type="radio" value=" 0" checked="checked" /></td>
  411.       <td><span class="style4">None</span></td>
  412.       <td bgcolor="#FFFFFF"><input name="hard" type="radio" value=" 0" checked="checked" /></td>
  413.       <td><span class="style4">None</span></td>
  414.     </tr>
  415.   </table>
  416.   <div align="left"><br />
  417.       <table width="916" border="0" cellspacing="1">
  418.         <tr bordercolor="#999999">
  419.           <th colspan="8" scope="col"><div align="left">SEVERITY OF CONSEQUENCE TABLE <br />
  420.             <span class="style4"><em>(Select one frome each group) </em></span></div></th>
  421.         </tr>
  422.         <tr>
  423.           <td width="20" rowspan="2">&nbsp;</td>
  424.           <td width="82" bgcolor="#999999"><div align="center" class="style4">SLA IMPACT</div></td>
  425.           <td width="20">&nbsp;</td>
  426.           <td width="228" bgcolor="#999999"><div align="center"><span class="style6">COST IMPACT </span></div></td>
  427.           <td width="20" rowspan="2">&nbsp;</td>
  428.           <td width="238" bgcolor="#999999"><div align="center"><span class="style6">TECHNICAL</span></div></td>
  429.           <td width="20" rowspan="2">&nbsp;</td>
  430.           <td width="263" rowspan="2" bgcolor="#999999"><div align="center" class="style4"><strong>CUSTOMER SATISFACTION </strong></div></td>
  431.         </tr>
  432.         <tr>
  433.           <td bgcolor="#CCCCCC"><div align="center" class="style4"></div>
  434.             <div align="center" class="style4">Amount</div></td>
  435.           <td width="20">&nbsp;</td>
  436.           <td bgcolor="#CCCCCC"><div align="center"><span class="style4">Probability</span></div></td>
  437.           <td bgcolor="#CCCCCC"><div align="center" class="style4">Alternative</div>
  438.             <div align="center" class="style4"></div></td>
  439.         </tr>
  440.         <tr>
  441.           <td valign="bottom" bgcolor="#99FF99"><input name="miss" type="radio" value="9" /></td>
  442.           <td valign="bottom" bgcolor="#99FF99"><div align="center"><span class="style4">75% or &gt;</span></div></td>
  443.           <td valign="bottom" bgcolor="#99FF99"><input name="cost" type="radio" value="9" /></td>
  444.           <td valign="bottom" bgcolor="#99FF99"><span class="style4"> Certain, program threatening </span></td>
  445.           <td bgcolor="#99FFFF"><input name="alter" type="radio" value="9" /></td>
  446.           <td bgcolor="#99FFFF"><span class="style4"> Cannot achieve. </span></td>
  447.           <td><input name="satis" type="radio" value="9" /></td>
  448.           <td><span class="style4"> Very high priority for the customer. </span></td>
  449.         </tr>
  450.         <tr>
  451.           <td><input name="miss" type="radio" value="8" /></td>
  452.           <td><div align="center"><span class="style4">61-74%</span></div></td>
  453.           <td><input name="cost" type="radio" value="8" /></td>
  454.           <td><span class="style4"> Extensive, program threatening. </span></td>
  455.           <td><input name="alter" type="radio" value="8" /></td>
  456.           <td><span class="style4"> Redesign or alternate required to achieve. </span></td>
  457.           <td rowspan="3" bgcolor="#FFCC99"><input name="satis" type="radio" value="8" /></td>
  458.           <td rowspan="3" bgcolor="#FFCC99"><span class="style4"> High priority for the customer. </span><span class="style4"> </span><span class="style4"> </span></td>
  459.         </tr>
  460.         <tr>
  461.           <td bgcolor="#99FF99"><input name="miss" type="radio" value="7" /></td>
  462.           <td bgcolor="#99FF99"><div align="center"><span class="style4">51-60%</span></div></td>
  463.           <td bgcolor="#99FF99"><input name="cost" type="radio" value="7" /></td>
  464.           <td bgcolor="#99FF99"><span class="style4"> Probable program threat. </span></td>
  465.           <td bgcolor="#99FFFF"><input name="alter" type="radio" value="7" /></td>
  466.           <td bgcolor="#99FFFF"><span class="style4"> No adequate backup. </span></td>
  467.         </tr>
  468.         <tr>
  469.           <td><input name="miss" type="radio" value="5" /></td>
  470.           <td><div align="center"><span class="style4">41-50%</span></div></td>
  471.           <td><input name="cost" type="radio" value="6" /></td>
  472.           <td><span class="style4"> Possible program threat. </span></td>
  473.           <td><input name="alter" type="radio" value="6" /></td>
  474.           <td><span class="style4"> </span>
  475.               <table cellspacing="0" cellpadding="0">
  476.                 <tr>
  477.                   <td width="144" valign="top"><p class="style4">Inferior backup. </p></td>
  478.                 </tr>
  479.             </table></td>
  480.         </tr>
  481.         <tr>
  482.           <td bgcolor="#99FF33"><input name="miss" type="radio" value="5" /></td>
  483.           <td bgcolor="#99FF99"><div align="center"><span class="style4">31-40%</span></div></td>
  484.           <td bgcolor="#99FF33"><input name="cost" type="radio" value="5" /></td>
  485.           <td bgcolor="#99FF99"><span class="style4"> Potential program threat. </span></td>
  486.           <td rowspan="3" bgcolor="#99FFFF"><input name="alter" type="radio" value="5" /></td>
  487.           <td rowspan="3" bgcolor="#99FFFF"><span class="style4"> Several adequate alternatives. </span></td>
  488.           <td rowspan="2"><input name="satis" type="radio" value="5" /></td>
  489.           <td rowspan="2"><span class="style4"> Medium level priority </span><span class="style4"> </span></td>
  490.         </tr>
  491.         <tr>
  492.           <td><input name="miss" type="radio" value="4" /></td>
  493.           <td><div align="center"><span class="style4">26-30%</span></div></td>
  494.           <td><input name="cost" type="radio" value="4" /></td>
  495.           <td><span class="style4"> Serious program component cost overrun. </span></td>
  496.         </tr>
  497.         <tr>
  498.           <td bgcolor="#99FF99"><input name="miss" type="radio" value="3" /></td>
  499.           <td bgcolor="#99FF99"><div align="center"><span class="style4">11 -25% </span></div></td>
  500.           <td bgcolor="#99FF99"><input name="cost" type="radio" value="3" /></td>
  501.           <td bgcolor="#99FF99"><span class="style4"> Rebudgeting required. </span></td>
  502.           <td rowspan="3" bgcolor="#FFCC99"><input name="satis" type="radio" value="3" /></td>
  503.           <td rowspan="3" bgcolor="#FFCC99"><span class="style4">Low level priority for the customer </span></td>
  504.         </tr>
  505.         <tr>
  506.           <td><input name="miss" type="radio" value="2" /></td>
  507.           <td><div align="center"><span class="style4">6-10%</span></div></td>
  508.           <td><input name="cost" type="radio" value="2" /></td>
  509.           <td><span class="style4"> Minor rebudgeting required. </span></td>
  510.           <td rowspan="2"><input name="alter" type="radio" value="2" /></td>
  511.           <td rowspan="2"><span class="style4"> Many adequate alternatives. </span></td>
  512.         </tr>
  513.         <tr>
  514.           <td height="17" bgcolor="#99FF99"><input name="miss" type="radio" value="1" /></td>
  515.           <td bgcolor="#99FF99"><div align="center"><span class="style4">5% or less </span></div></td>
  516.           <td bgcolor="#99FF99"><input name="cost" type="radio" value="1" /></td>
  517.           <td bgcolor="#99FF99"><span class="style4"> Negligible effect on budget. </span></td>
  518.         </tr>
  519.         <tr valign="bottom">
  520.           <td><input name="miss" type="radio" value="0" checked="checked" /></td>
  521.           <td valign="bottom"><div align="center"><span class="style4">None</span></div></td>
  522.           <td><input name="cost" type="radio" value="0" checked="checked" /></td>
  523.           <td><span class="style4"> None </span></td>
  524.           <td bgcolor="#99FFFF"><input name="alter" type="radio" value="0" checked="checked" /></td>
  525.           <td bgcolor="#99FFFF"><span class="style4">None </span></td>
  526.           <td><input name="satis" type="radio" value="0" checked="checked" /></td>
  527.           <td><span class="style4"> Not a priority for the customer </span></td>
  528.         </tr>
  529.         </table>
  530.   </div>
  531.   <p align="left"><span class="style4">Risk Occurance Timeframe: This risk could occur during the following timeframe(s)</span><br />
  532.     <input name="txt_tf" type="text" id="txt_tf2" size="6" maxlength="3" />
  533.     <select name="cbo_tf" size="1" id="select6">
  534.       <option value=""></option>
  535.       <option value="days">day(s)</option>
  536.       <option value="months">month(s)</option>
  537.       <option value="years">year(s)</option>
  538.     </select>
  539. </p>
  540.   <p align="left"><span class="style4">Key Stakeholders <br />
  541.       <textarea name="txt_sh" cols="70" rows="5" id="txt_sh"></textarea>
  542.   </span><span class="style4"><br />
  543.     Risk Impact Scenario </span><br />
  544.     <textarea name="txt_is" cols="70" rows="5" id="txt_is"></textarea> 
  545.   </p>
  546.   <p align="left">Risk Prevention Scenario:<br />
  547.     <input type="radio" name= "risk_prevent" value ="Short Term:" checked="checked" />
  548. Short term mitigation strategies<br/>
  549. <input type="radio" name= "risk_prevent" value ="Mid Term:" />
  550. Mid term mitigation strategies<br />
  551. <input type="radio" name= "risk_prevent" value ="Long Term:" />
  552. Long term mitigation strategies </p>
  553.   <p align="left"><span class="style1">Indicate at what point the risk will be lowered</span></p>
  554.   <p align="left">
  555.     <textarea name="txt_prev_ac" cols="70" rows="5" id="textarea3"></textarea>
  556.   </p>
  557.   <p align="left"><br>
  558.     <br>
  559.     <br>
  560.     <br>
  561.     <input type="submit" name="submitrisk"  value="Submit">
  562.     <br>
  563.     <br>
  564.     <input type="button" value="Return to Index" onClick="window.location='member-index.php' ">
  565.     <input type="button" value="Logout" onClick="window.location='logout.php' ">
  566. </p>
  567.   </center>
  568. </FORM>
  569.  
  570. </BODY>
  571. </HTML>
  572.  
  573.  
  574.  
here is the javascript piece

Expand|Select|Wrap|Line Numbers
  1.  
  2. //check for empty fields
  3.  
  4. function validate_required(field,alerttxt) 
  5. {
  6.     with (field)
  7.       {
  8.       if (value==null||value=="")
  9.         {
  10.         alert(alerttxt);return false;
  11.         }
  12.       else
  13.         {
  14.         return true;
  15.         }
  16.       }
  17. }
  18.  
  19.  
  20. //VALIDATE NEW REQUESTS
  21. function validate_form(thisform)
  22. {
  23.     with (thisform)
  24.       {
  25.         if (validate_required(cbo_subtsk,"Please select a subtask owner!")==false)
  26.             {cbo_subtsk.focus();return false;}
  27.  
  28.           if (validate_required(cbo_risk_cat,"Please select a risk category!")==false)
  29.             {cbo_risk_cat.focus();return false;}
  30.  
  31.  
  32.         if (validate_required(cbo_risk_type,"Please select a risk type!")==false)
  33.             {cbo_risk_type.focus();return false;}
  34.  
  35.  
  36.         if (validate_required(cbo_owner,"Please select a risk owner!")==false)
  37.             {cbo_owner.focus();return false;}
  38.  
  39.  
  40.         if (validate_required(txt_req_des,"Please enter risk description!")==false)
  41.             {txt_req_des.focus();return false;}
  42.  
  43.  
  44.           if (validate_required(txt_tf,"Please enter numeric time frame!")==false)
  45.             {txt_tf.focus();return false;}
  46.  
  47.  
  48.         if (validate_required(cbo_tf,"Please select time frame measurement")==false)
  49.             {cbo_tf.focus();return false;}
  50.  
  51.  
  52.         if (validate_required(txt_sh,"Please enter risk statke holders")==false)
  53.             {txt_sh.focus();return false;}
  54.  
  55.  
  56.         if (validate_required(txt_is,"Please enter risk impact scenario")==false)
  57.             {txt_is.focus();return false;}  
  58.  
  59.         if (validate_required(txt_prev_ac,"Please enter prevention scenario")==false)
  60.             {txt_prev_ac.focus();return false;}
  61.  
  62.         if (validate_required(txt_analsyst,"Please enter risk analsyst")==false)
  63.             {txt_analsyst.focus();return false;}
  64.  
  65.  
  66.       }
  67. }
  68.  
  69.  
I am pretty sure its correct but when it passes through it does not error handle.
Jun 14 '10 #1
4 2142
dlite922
1,584 Recognized Expert Top Contributor
You need to learn debugging. Especially for code you wrote.

Trace your code and tell us where it's broken. If you can't fix it, let us know what the problem is by describing:

1. What it's doing.
2. What it should do
3. What have you tried to fix it.

If you do end up fixing it, post the solution here for the next person to see.

Thanks,

Dan
Jun 14 '10 #2
maxamis4
295 Recognized Expert Contributor
You are absolutly correct. My apologies for not providing more details.

Based on the questions you have posted here are some more details related to the problem:

1. What it's doing and 2. What it should do
I mentioned i had it working before. What it does (most of you already know) was display a error box that the value is missing and then it would set focus to the value missing. At this point it does not validate at all. If I leave a value blank no errors occur and my form proceeds to the next form for submission which will throw errors due to the sql statement inserting null statements.


3. What have you tried to fix it.

i tried removing my action page in order to force it to go to the java module first. Additionally I took out all the validation variables except for one and I still could not get it too work with a text box. I tried playing with the call feature and using my actual form name versus "this". Nothing I have tried seems to make it want to validate and unfortunately java is not my strong point. From a parameter perspective the validation looks good. So i need help to determine why it is not going through the function. Also just to point it out I even tried adding the java script header at the top of the page.

Any help would be great.
Jun 14 '10 #3
anfetienne
424 Contributor
if im honest i think you should directly check each field length for validation... i would use the following if statement then appropriately alert and focus on the field

Expand|Select|Wrap|Line Numbers
  1.     if (form_name.field_name.value.length == 0) 
  2.     { 
  3.     } 
  4.  
Jun 15 '10 #4
maxamis4
295 Recognized Expert Contributor
Folks for purposes of time I ended up placing the javascript inside the head of the page that i was validating. Not the way i wanted to go but it performed the validation. I have posted my code in the case that anyone wanted to see what I did.

Again basically I just went away from two files to one (although I wanted to keep the functions separate to call them at anytime.)

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     require_once('auth.php');
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8. <link href="loginmodule.css" rel="stylesheet" type="text/css" />
  9.     <TITLE>Significant Activities</TITLE>
  10. <SCRIPT language="javascript" type='text/javascript'>
  11.  
  12.     //VALIDATE NEW REQUESTS
  13.     function validate_form(thisform)
  14.     {
  15.         with (thisform)
  16.           {
  17.             if (validate_required(cbo_subtsk,"Please select a subtask owner!")==false)
  18.                 {cbo_subtsk.focus();return false;}
  19.  
  20.  
  21.             if (validate_required(cbo_risk_cat,"Please select a risk category!")==false)
  22.                 {cbo_risk_cat.focus();return false;}
  23.  
  24.  
  25.             if (validate_required(cbo_risk_type,"Please select a risk type!")==false)
  26.                 {cbo_risk_type.focus();return false;}
  27.  
  28.  
  29.             if (validate_required(cbo_owner,"Please select a risk owner!")==false)
  30.                 {cbo_owner.focus();return false;}
  31.  
  32.             if (validate_required(txt_req_des,"Please enter risk description!")==false)
  33.                 {txt_req_des.focus();return false;}
  34.  
  35.  
  36.             if (validate_required(txt_tf,"Please enter numeric time frame!")==false)
  37.                 {txt_tf.focus();return false;}
  38.  
  39.  
  40.             if (isNumeric(txt_tf,"You must enter a number!")==false)
  41.                 {txt_tf.focus();return false;}
  42.  
  43.  
  44.             if (validate_required(cbo_tf,"Please select time frame measurement")==false)
  45.                 {cbo_tf.focus();return false;}
  46.  
  47.  
  48.             if (validate_required(txt_sh,"Please enter risk statke holders")==false)
  49.                 {txt_sh.focus();return false;}
  50.  
  51.  
  52.             if (validate_required(txt_is,"Please enter risk impact scenario")==false)
  53.                 {txt_is.focus();return false;}  
  54.  
  55.  
  56.             if (validate_required(txt_prev_ac,"Please enter prevention scenario")==false)
  57.                 {txt_prev_ac.focus();return false;}
  58.  
  59.  
  60.             if (validate_required(txt_analsyst,"Please enter risk analsyst")==false)
  61.                 {txt_analsyst.focus();return false;}
  62.  
  63.           }
  64.     }
  65.  
  66.     //DETERMINE IF VALUE IS EMPTY
  67.     function validate_required(field,alerttxt) 
  68.     {
  69.         with (field)
  70.           {
  71.           if (value==null||value=="")
  72.             {
  73.             alert(alerttxt);return false;
  74.             }
  75.           else
  76.             {
  77.             return true;
  78.             }
  79.           }
  80.     }
  81.  
  82.     // If the element's string matches the regular expression it is all numbers
  83.     function isNumeric(elem, helperMsg)
  84.     {
  85.         var numericExpression = /^[0-9]+$/;
  86.         if(elem.value.match(numericExpression))
  87.         {
  88.             return true;
  89.         }
  90.         else
  91.         {
  92.             alert(helperMsg);
  93.             return false;
  94.         }
  95.     }
  96.  
  97. </SCRIPT>
  98.  
  99. </HEAD>
  100. <BODY>
  101.  
  102. <?php
  103.     //Include database connection details
  104.     require_once('configrisks.php');
  105.  
  106.     //Array to store validation errors
  107.     $errmsg_arr = array();
  108.  
  109.     //Validation error flag
  110.     $errflag = false;
  111.  
  112.     //Connect to mysql server
  113.     $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  114.     if(!$link) {
  115.         die('Failed to connect to server: ' . mysql_error());
  116.     }
  117.  
  118.     //Select database
  119.     $db = mysql_select_db(DB_DATABASE);
  120.     if(!$db) {
  121.         die("Unable to select database");
  122.     }
  123.  
  124.     //Function to sanitize values received from the form. Prevents SQL injection
  125.     function clean($str) {
  126.         $str = @trim($str);
  127.         if(get_magic_quotes_gpc()) {
  128.             $str = stripslashes($str);
  129.         }
  130.         return mysql_real_escape_string($str);
  131.     }
  132.  
  133.  
  134.  
  135.     //************************************************************************************
  136.     //                                        BUILD ARRAYS
  137.     //====================================================================================
  138.  
  139.     //================================ARRAY 1=====================================
  140.  
  141.         //CREATE DROP DOWNS FOR FORM USAGE
  142.     $sql = "SELECT proj_sym, proj_description FROM tbl_project_type WHERE proj_code = 'risk' AND proj_active = 1";
  143.     $proj = mysql_query($sql);
  144.     if($proj) 
  145.     {
  146.         $proj_num = mysql_num_rows($proj);
  147.  
  148.  
  149.         //Loop through data array
  150.         while($row=mysql_fetch_assoc($proj))
  151.         {
  152.             $proj_array_sym[]=$row["proj_sym"];
  153.             $proj_array_description[]=$row["proj_description"];
  154.         };
  155.  
  156.     }
  157.     else
  158.     {
  159.  
  160.         echo "Array1";
  161.         die('Error reading user data');
  162.  
  163.     }
  164.  
  165.  
  166.     //============================= ARRAY 1 END ================================
  167.  
  168.  
  169.  
  170.     //================================ARRAY 2===================================
  171.  
  172.     //CREATE DROP DOWNS FOR FORM USAGE
  173.     $sql = "SELECT cat_uuid, cat_code FROM tbl_cat WHERE cat_proj_code = 'risk' AND active = 1";
  174.     $cat = mysql_query($sql);
  175.     if($cat) 
  176.     {
  177.         $cat_num = mysql_num_rows($cat);
  178.  
  179.         //Loop through data array
  180.         while($row=mysql_fetch_assoc($cat))
  181.         {
  182.             $cat_array_uuid[]=$row["cat_uuid"];
  183.             $cat_array_code[]=$row["cat_code"];
  184.         };
  185.  
  186.     }
  187.     else
  188.     {
  189.  
  190.         echo "Array2";
  191.         die('Error reading user data');
  192.     }
  193.  
  194.     //============================END ARRAY 2===================================
  195.  
  196.  
  197.     //================================ARRAY 3===================================
  198.         //CREATE DROP DOWNS FOR FORM USAGE
  199.     $sql = "SELECT code, des FROM tbl_department WHERE proj_code = 'risk' AND active = 1";
  200.     $dep = mysql_query($sql);
  201.     if($dep) 
  202.     {
  203.         $dep_num = mysql_num_rows($dep);
  204.  
  205.  
  206.         //Loop through data array
  207.         while($row=mysql_fetch_assoc($dep))
  208.         {
  209.             $dep_array_code[]=$row["code"];
  210.             $dep_array_des[]=$row["des"];
  211.         };
  212.  
  213.     }
  214.     else
  215.     {
  216.  
  217.         echo "Array3";
  218.         die('Error reading user data');
  219.     }
  220.  
  221.     //================================ARRAY 4===================================
  222.     //CREATE DROP DOWNS FOR FORM USAGE
  223.     $sql = "SELECT id, realname, firstname FROM tbl_users WHERE (active = 1) AND (st_manager=1 OR rsk_manager =1) ORDER BY realname;";
  224.     $user = mysql_query($sql);
  225.     if($dep) 
  226.     {
  227.         $user_num = mysql_num_rows($user);
  228.  
  229.  
  230.         //Loop through data array
  231.         while($row=mysql_fetch_assoc($user))
  232.         {
  233.             $user_array_id[]=$row["id"];
  234.             $user_array_last[]=$row["realname"];
  235.             $user_array_first[]=$row["firstname"];
  236.  
  237.         };
  238.  
  239.     }
  240.     else
  241.     {
  242.  
  243.         echo "Array4";
  244.         die('Error reading user data');
  245.     }
  246.  
  247.  
  248.  
  249.  
  250.     //============================END ARRAY 3===================================
  251.  
  252.  
  253. ?>
  254.  
  255. <FORM NAME="blank_risk_form" id="blank_risk_form" method="post" action="submitnewrisk.php" onsubmit="return validate_form(this)">
  256.   <font face="Arial, Helvetica, sans-serif"><center>
  257.   <th colspan=3><center><h1>Risk Identification Form</h1>
  258.   <p align="left">
  259.     <input type="text" name="user" value="<?php echo $_SESSION['SESS_FIRST_NAME']; echo ' '; echo $_SESSION['SESS_LAST_NAME']; ?>" />
  260.   </p>
  261.   <p align="left">
  262.     <input type="text" name="currentdate" value="<?php $cdate=date('Y-m-d'); echo $cdate; ?>" />
  263. </p>
  264.   <p align="left">Originated By
  265.     <?php 
  266.                     echo $_SESSION['SESS_FIRST_NAME']; 
  267.                     echo ' '; 
  268.                     echo $_SESSION['SESS_LAST_NAME']; 
  269.                 ?>
  270. </p>
  271.   <p align="left"><span class="style4">Date Submitted:
  272.       <?php 
  273.                     $cdate=date("Y-m-d"); 
  274.                     echo $cdate; 
  275.                 ?>
  276.   </span></p>
  277.   <p align="left"><span class="style2"><span class="style4">Subtask Owner: </span> </span>
  278.  
  279.     <select name="cbo_subtsk" id="select2" >
  280.                   <?php
  281.                     //BUILD DROP DOWN LIST
  282.  
  283.                     //FOR STATEMENT 1 START
  284.                         echo '<option value=""></option>';
  285.                         for ($array_1index=0; $array_1index < $dep_num; $array_1index += 1) 
  286.                         {
  287.  
  288.                                 echo '<option value='; 
  289.                                 echo $dep_array_code[$array_1index];
  290.                                 echo '>'; 
  291.                                 echo $dep_array_des[$array_1index]; 
  292.                                 echo '</option>';
  293.  
  294.                         }//FOR STATEMENT 1 END
  295.  
  296.                     ?>
  297.     </select>
  298. </p>
  299.   <p align="left"><span class="style2"><span class="style4">Risk Category:
  300.         <select name="cbo_risk_cat" id="select3">
  301.           <?php
  302.                     //BUILD DROP DOWN LIST
  303.  
  304.                     //FOR STATEMENT 2 START
  305.                         echo '<option value=""></option>';
  306.                         for ($array_1index=0; $array_1index < $cat_num; $array_1index += 1) 
  307.                         {
  308.  
  309.                                 echo '<option value='; 
  310.                                 echo $cat_array_uuid[$array_1index];
  311.                                 echo '>'; 
  312.                                 echo $cat_array_code[$array_1index]; 
  313.                                 echo '</option>';
  314.  
  315.                         }//FOR STATEMENT 2 END
  316.  
  317.                     ?>
  318.         </select>
  319. </span></span></p>
  320.   <p align="left"><span class="style4">Type of Risk: </span>
  321.     <select name="cbo_risk_type" id="select4" >
  322.       <?php
  323.                     //BUILD DROP DOWN LIST
  324.  
  325.                     //FOR STATEMENT 1 START
  326.                     echo '<option value=""></option>';
  327.                         for ($array_1index=0; $array_1index < $proj_num; $array_1index += 1) 
  328.                         {
  329.  
  330.                                 echo '<option value='; 
  331.                                 echo $proj_array_sym[$array_1index];
  332.                                 echo '>'; 
  333.                                 echo $proj_array_description[$array_1index]; 
  334.                                 echo '</option>';
  335.  
  336.                         }//FOR STATEMENT 1 END
  337.  
  338.                     ?>
  339.     </select>
  340.     </p>
  341.   <p align="left"><span class="style4">Owner:
  342.       <select name="cbo_owner" id="select5" >
  343.         <?php
  344.                     //BUILD DROP DOWN LIST
  345.  
  346.                     //FOR STATEMENT 1 START
  347.                     echo '<option value=""></option>';
  348.                         for ($array_1index=0; $array_1index < $user_num; $array_1index += 1) 
  349.                         {
  350.  
  351.                                 echo '<option value='; 
  352.                                 echo $user_array_id[$array_1index];
  353.                                 echo '>'; 
  354.                                 echo $user_array_last[$array_1index];
  355.                                 echo ", ";
  356.                                 echo $user_array_first[$array_1index];
  357.                                 echo '</option>';
  358.  
  359.                         }//FOR STATEMENT 1 END
  360.  
  361.                     ?>
  362.       </select>
  363.       </span></p>
  364.   <p align="left">Orginal Create Date:
  365.     <input name="txt_date" type="text" id="txt_date" value="<?php $cdate=date('m/d/Y'); echo $cdate; ?>"/>
  366.     mm/dd/yyyy</p>
  367.   <p align="left"><span class="style4">Please describe your risk:</span> <br />
  368.     <textarea name="txt_req_des" cols="75" rows="5" id="textarea2"></textarea>
  369.   <p align="left">
  370.   <div align="left">
  371.   <table width="969" border="0" cellpadding="0" cellspacing="1">
  372.     <tr bordercolor="#999999">
  373.       <th colspan="8" scope="col"><div align="left">PROBABILITY OF OCCURENCE<br />
  374.               <span class="style4"><em>(Select one frome each group) </em></span></div></th>
  375.     </tr>
  376.     <tr>
  377.       <td width="20">&nbsp;</td>
  378.       <td width="226" bordercolor="#999999" bgcolor="#CCCCCC"><div align="center"><span class="style9">RESOURCES</span></div></td>
  379.       <td width="20">&nbsp;</td>
  380.       <td width="240" bgcolor="#CCCCCC"><div align="center"><span class="style4">REQUIREMENTS</span></div></td>
  381.       <td width="20">&nbsp;</td>
  382.       <td width="219" bgcolor="#CCCCCC"><div align="center"><span class="style4">TECHNOLOGY</span></div></td>
  383.       <td width="20">&nbsp;</td>
  384.       <td width="239" bgcolor="#CCCCCC"><div align="center"><span class="style4"><strong>HARDWARE</strong></span></div></td>
  385.     </tr>
  386.     <tr bordercolor="#000000">
  387.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=".9" /></td>
  388.       <td bgcolor="#CCFF99"><span class="style4"> Not available and good probability of significant deficiencies in meeting skill needs. </span></td>
  389.       <td><input name="req" type="radio" value=".9" /></td>
  390.       <td><span class="style4"> Good probability of significant deficiencies in meeting requirements. </span></td>
  391.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".9" /></td>
  392.       <td bgcolor="#CCFF99"><span class="style4"> Maximum technology/maximum capability. </span></td>
  393.       <td><input name="hard" type="radio" value=".9" /></td>
  394.       <td><span class="style4"> Theoretical design based on advanced research. </span></td>
  395.     </tr>
  396.     <tr bordercolor="#FFFFFF">
  397.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=".8" /></td>
  398.       <td bgcolor="#CCFF99"><span class="style4">Not readily available and good probability of some moderate deficiencies in meeting skill needs. </span></td>
  399.       <td><input name="req" type="radio" value=".8" /></td>
  400.       <td><span class="style4"> Good probability of some moderate deficiencies in meeting all requirements. </span></td>
  401.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".8" /></td>
  402.       <td bgcolor="#CCFF99"><span class="style4"> Theoretical technology. </span></td>
  403.       <td><input name="hard" type="radio" value=".8" /></td>
  404.       <td><span class="style4"> New theoretical design. </span></td>
  405.     </tr>
  406.     <tr bordercolor="#FFFFFF">
  407.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=".7" /></td>
  408.       <td bgcolor="#CCFF99"><span class="style4">Not readily available and moderate chance of moderate deficiencies in meeting skill needs. </span></td>
  409.       <td><input name="req" type="radio" value=".7" /></td>
  410.  
  411.       <td><span class="style4"> Moderate chance of moderate deficiencies in meeting all requirements. </span></td>
  412.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".7" /></td>
  413.       <td bgcolor="#CCFF99"><span class="style4"> Newer technology. </span></td>
  414.       <td><input name="hard" type="radio" value=".7" /></td>
  415.       <td><span class="style4"> All new design. </span></td>
  416.     </tr>
  417.     <tr bordercolor="#FFFFFF">
  418.       <td rowspan="2" bgcolor="#CCFF99"><input name="res" type="radio" value=".6" /></td>
  419.       <td rowspan="2" bgcolor="#CCFF99"><span class="style4">Not readily available and moderate chance of moderate deficiencies in meeting skill needs. </span><span class="style4"> </span></td>
  420.       <td><input name="req" type="radio" value=".6" /></td>
  421.       <td><span class="style4"> Moderate chance of minor requirement deficiencies. </span></td>
  422.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".6" /></td>
  423.       <td bgcolor="#CCFF99"><span class="style4"> Available technology. Feasible by analogy. </span></td>
  424.       <td><input name="hard" type="radio" value=".6" /></td>
  425.       <td><span class="style4"> New design to moderately improve existing design. </span></td>
  426.     </tr>
  427.     <tr>
  428.       <td><input name="req" type="radio" value=".5" /></td>
  429.       <td><span class="style4"> Some chance of minor requirement deficiencies. </span></td>
  430.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".5" /></td>
  431.       <td bgcolor="#CCFF99"><span class="style4"> Existing technology and feasibility studies. </span></td>
  432.       <td><input name="hard" type="radio" value=".5" /></td>
  433.       <td><span class="style4"> Major design change. </span></td>
  434.     </tr>
  435.     <tr bordercolor="#FFFFFF">
  436.       <td rowspan="2" bgcolor="#CCFF99"><input name="res" type="radio" value=".4" /></td>
  437.       <td rowspan="2" bgcolor="#CCFF99"><span class="style4"> Available and some chance of minor deficiencies in meeting skill needs. </span><span class="style4"> </span></td>
  438.       <td><input name="req" type="radio" value=".4" /></td>
  439.       <td><span class="style4"> Slight chance of minor requirement deficiencies. </span></td>
  440.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".4" /></td>
  441.       <td bgcolor="#CCFF99"><span class="style4"> Proven technology and approach. </span></td>
  442.       <td><input name="hard" type="radio" value=".4" /></td>
  443.       <td><span class="style4"> Redesign, significant modifications. </span></td>
  444.     </tr>
  445.     <tr>
  446.       <td><input name="req" type="radio" value=".3" /></td>
  447.       <td><span class="style4"> Should meet all requirements with little margin. </span></td>
  448.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".3" /></td>
  449.       <td bgcolor="#CCFF99"><span class="style4"> Proven technology and approach, used by some design agent. </span></td>
  450.       <td><input name="hard" type="radio" value=".3" /></td>
  451.       <td><span class="style4"> Existing proven components, recombined or minor mods in function. </span></td>
  452.     </tr>
  453.     <tr bordercolor="#FFFFFF">
  454.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=".2" /></td>
  455.       <td bgcolor="#CCFF99"><span class="style4"> Available and should meet all skill needs with little margin. </span></td>
  456.       <td><input name="req" type="radio" value=".2" /></td>
  457.       <td><span class="style4"> Should meet all requirements, and exceed many. </span></td>
  458.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".2" /></td>
  459.       <td bgcolor="#CCFF99"><span class="style4"> Proven technology and approach with significant design agent experience. </span></td>
  460.       <td><input name="hard" type="radio" value=".2" /></td>
  461.       <td><span class="style4"> Existing proven components, repackaged and/or minor usage variation. </span></td>
  462.     </tr>
  463.     <tr bordercolor="#FFFFFF">
  464.       <td height="47" bgcolor="#CCFF99"><input name="res" type="radio" value=".1" /></td>
  465.       <td bgcolor="#CCFF99"><span class="style4"> Available and should meet all skill needs, and exceed many. </span></td>
  466.       <td><input name="req" type="radio" value=".1" /></td>
  467.       <td><span class="style4"> Will meet all requirements, exceeding many. </span></td>
  468.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=".1" /></td>
  469.       <td bgcolor="#CCFF99"><span class="style4"> Proven technology and approach with significant design agent experience. </span></td>
  470.       <td><input name="hard" type="radio" value=".1" /></td>
  471.       <td><span class="style4"> Functional hardware only. Mods in form only. </span></td>
  472.     </tr>
  473.     <tr bordercolor="#FFFFFF">
  474.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=".01" /></td>
  475.       <td bgcolor="#CCFF99"><span class="style4"> Available and will meet and exceed all skill needs. </span></td>
  476.       <td><input name="req" type="radio" value="0.01" /></td>
  477.       <td><span class="style4"> Will exceed all requirements with margin. </span></td>
  478.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value="0.01" /></td>
  479.       <td bgcolor="#CCFF99"><span class="style4"> Off-the-shelf technology proven to operational environments. </span></td>
  480.       <td><input name="hard" type="radio" value="0.01" /></td>
  481.       <td><span class="style4"> Functional hardware. </span></td>
  482.     </tr>
  483.     <tr bordercolor="#FFFFFF">
  484.       <td bgcolor="#CCFF99"><input name="res" type="radio" value=" 0" checked="checked" /></td>
  485.       <td bgcolor="#CCFF99"><span class="style4">None</span></td>
  486.       <td><input name="req" type="radio" value=" 0" checked="checked" /></td>
  487.       <td><span class="style4">None</span></td>
  488.       <td bgcolor="#CCFF99"><input name="tech" type="radio" value=" 0" checked="checked" /></td>
  489.       <td bgcolor="#CCFF99"><span class="style4">None</span></td>
  490.       <td><input name="hard" type="radio" value=" 0" checked="checked" /></td>
  491.       <td><span class="style4">None</span></td>
  492.     </tr>
  493.   </table></div>
  494.   <div align="left"><br />
  495.       <table width="916" border="0" cellspacing="1">
  496.         <tr bordercolor="#999999">
  497.           <th colspan="8" scope="col"><div align="left">SEVERITY OF CONSEQUENCE TABLE <br />
  498.             <span class="style4"><em>(Select one frome each group) </em></span></div></th>
  499.         </tr>
  500.         <tr>
  501.           <td width="20" rowspan="2">&nbsp;</td>
  502.           <td width="82" bgcolor="#CCCCCC"><div align="center" class="style4">SLA IMPACT</div></td>
  503.           <td width="20">&nbsp;</td>
  504.           <td width="228" bgcolor="#CCCCCC"><div align="center"><span class="style6">COST IMPACT </span></div></td>
  505.           <td width="20" rowspan="2">&nbsp;</td>
  506.           <td width="238" bgcolor="#CCCCCC"><div align="center"><span class="style6">TECHNICAL</span></div></td>
  507.           <td width="20" rowspan="2">&nbsp;</td>
  508.           <td width="263" rowspan="2" bgcolor="#CCCCCC"><div align="center" class="style4"><strong>CUSTOMER SATISFACTION </strong></div></td>
  509.         </tr>
  510.         <tr>
  511.           <td bgcolor="#FFFFCC"><div align="center" class="style4"></div>
  512.             <div align="center" class="style4">Amount</div></td>
  513.           <td width="20">&nbsp;</td>
  514.           <td bgcolor="#FFFFCC"><div align="center"><span class="style4">Probability</span></div></td>
  515.           <td bgcolor="#FFFFCC"><div align="center" class="style4">Alternative</div>
  516.             <div align="center" class="style4"></div></td>
  517.         </tr>
  518.         <tr>
  519.           <td valign="bottom" bgcolor="#FFCC99"><input name="miss" type="radio" value="9" /></td>
  520.           <td valign="bottom" bgcolor="#FFCC99"><div align="center"><span class="style4">75% or &gt;</span></div></td>
  521.           <td valign="bottom"><input name="cost" type="radio" value="9" /></td>
  522.           <td valign="bottom"><span class="style4"> Certain, program threatening </span></td>
  523.           <td bgcolor="#FFCC99"><input name="alter" type="radio" value="9" /></td>
  524.           <td bgcolor="#FFCC99"><span class="style4"> Cannot achieve. </span></td>
  525.           <td><input name="satis" type="radio" value="9" /></td>
  526.           <td><span class="style4"> Very high priority for the customer. </span></td>
  527.         </tr>
  528.         <tr>
  529.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="8" /></td>
  530.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">61-74%</span></div></td>
  531.           <td><input name="cost" type="radio" value="8" /></td>
  532.           <td><span class="style4"> Extensive, program threatening. </span></td>
  533.           <td bgcolor="#FFCC99"><input name="alter" type="radio" value="8" /></td>
  534.           <td bgcolor="#FFCC99"><span class="style4"> Redesign or alternate required to achieve. </span></td>
  535.           <td rowspan="3"><input name="satis" type="radio" value="8" /></td>
  536.           <td rowspan="3"><span class="style4"> High priority for the customer. </span><span class="style4"> </span><span class="style4"> </span></td>
  537.         </tr>
  538.         <tr>
  539.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="7" /></td>
  540.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">51-60%</span></div></td>
  541.           <td><input name="cost" type="radio" value="7" /></td>
  542.           <td><span class="style4"> Probable program threat. </span></td>
  543.           <td bgcolor="#FFCC99"><input name="alter" type="radio" value="7" /></td>
  544.           <td bgcolor="#FFCC99"><span class="style4"> No adequate backup. </span></td>
  545.         </tr>
  546.         <tr>
  547.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="5" /></td>
  548.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">41-50%</span></div></td>
  549.           <td><input name="cost" type="radio" value="6" /></td>
  550.           <td><span class="style4"> Possible program threat. </span></td>
  551.           <td bgcolor="#FFCC99"><input name="alter" type="radio" value="6" /></td>
  552.           <td bgcolor="#FFCC99"><span class="style4"> </span>
  553.               <table cellspacing="0" cellpadding="0">
  554.                 <tr>
  555.                   <td width="144" valign="top"><p class="style4">Inferior backup. </p></td>
  556.                 </tr>
  557.             </table></td>
  558.         </tr>
  559.         <tr>
  560.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="5" /></td>
  561.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">31-40%</span></div></td>
  562.           <td><input name="cost" type="radio" value="5" /></td>
  563.           <td><span class="style4"> Potential program threat. </span></td>
  564.           <td rowspan="3" bgcolor="#FFCC99"><input name="alter" type="radio" value="5" /></td>
  565.           <td rowspan="3" bgcolor="#FFCC99"><span class="style4"> Several adequate alternatives. </span></td>
  566.           <td rowspan="2"><input name="satis" type="radio" value="5" /></td>
  567.           <td rowspan="2"><span class="style4"> Medium level priority </span><span class="style4"> </span></td>
  568.         </tr>
  569.         <tr>
  570.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="4" /></td>
  571.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">26-30%</span></div></td>
  572.           <td><input name="cost" type="radio" value="4" /></td>
  573.           <td><span class="style4"> Serious program component cost overrun. </span></td>
  574.         </tr>
  575.         <tr>
  576.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="3" /></td>
  577.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">11 -25% </span></div></td>
  578.           <td><input name="cost" type="radio" value="3" /></td>
  579.           <td><span class="style4"> Rebudgeting required. </span></td>
  580.           <td rowspan="3"><input name="satis" type="radio" value="3" /></td>
  581.           <td rowspan="3"><span class="style4">Low level priority for the customer </span></td>
  582.         </tr>
  583.         <tr>
  584.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="2" /></td>
  585.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">6-10%</span></div></td>
  586.           <td><input name="cost" type="radio" value="2" /></td>
  587.           <td><span class="style4"> Minor rebudgeting required. </span></td>
  588.           <td rowspan="2" bgcolor="#FFCC99"><input name="alter" type="radio" value="2" /></td>
  589.           <td rowspan="2" bgcolor="#FFCC99"><span class="style4"> Many adequate alternatives. </span></td>
  590.         </tr>
  591.         <tr>
  592.           <td height="17" bgcolor="#FFCC99"><input name="miss" type="radio" value="1" /></td>
  593.           <td bgcolor="#FFCC99"><div align="center"><span class="style4">5% or less </span></div></td>
  594.           <td><input name="cost" type="radio" value="1" /></td>
  595.           <td><span class="style4"> Negligible effect on budget. </span></td>
  596.         </tr>
  597.         <tr valign="bottom">
  598.           <td bgcolor="#FFCC99"><input name="miss" type="radio" value="0" checked="checked" /></td>
  599.           <td valign="bottom" bgcolor="#FFCC99"><div align="center"><span class="style4">None</span></div></td>
  600.           <td><input name="cost" type="radio" value="0" checked="checked" /></td>
  601.           <td><span class="style4"> None </span></td>
  602.           <td bgcolor="#FFCC99"><input name="alter" type="radio" value="0" checked="checked" /></td>
  603.           <td bgcolor="#FFCC99"><span class="style4">None </span></td>
  604.           <td><input name="satis" type="radio" value="0" checked="checked" /></td>
  605.           <td><span class="style4"> Not a priority for the customer </span></td>
  606.         </tr>
  607.         </table>
  608.   </div>
  609.   <p align="left"><span class="style4">Risk Occurance Timeframe: This risk could occur during the following timeframe(s)</span><br />
  610.     <input name="txt_tf" type="text" id="txt_tf2" size="6" maxlength="3" />
  611.     <select name="cbo_tf" size="1" id="select6">
  612.       <option value=""></option>
  613.       <option value="days">day(s)</option>
  614.       <option value="months">month(s)</option>
  615.       <option value="years">year(s)</option>
  616.     </select>
  617. </p>
  618.   <p align="left"><span class="style4">Key Stakeholders <br />
  619.       <textarea name="txt_sh" cols="70" rows="5" id="txt_sh"></textarea>
  620.   </span><span class="style4"><br />
  621.     Risk Impact Scenario </span><br />
  622.     <textarea name="txt_is" cols="70" rows="5" id="txt_is"></textarea> 
  623.   </p>
  624.   <p align="left">Risk Prevention Scenario:<br />
  625.     <input type="radio" name= "risk_prevent" value ="Short Term:" checked="checked" />
  626. Short term mitigation strategies<br/>
  627. <input type="radio" name= "risk_prevent" value ="Mid Term:" />
  628. Mid term mitigation strategies<br />
  629. <input type="radio" name= "risk_prevent" value ="Long Term:" />
  630. Long term mitigation strategies </p>
  631.   <p align="left"><span class="style1">Indicate at what point the risk will be lowered</span></p>
  632.   <p align="left">
  633.     <textarea name="txt_prev_ac" cols="70" rows="5" id="textarea3"></textarea>
  634.   </p>
  635.   <p align="left"><br>
  636.     <br>
  637.     <br>
  638.     <br>
  639.     <input type="submit" name="submitrisk"  value="Submit">
  640.     <br>
  641.     <br>
  642.     <input type="button" value="Return to Index" onClick="window.location='member-index.php' ">
  643.     <input type="button" value="Logout" onClick="window.location='logout.php' ">
  644. </p>
  645.   </center>
  646. </FORM>
  647.  
  648. </BODY>
  649. </HTML>
  650.  
  651.  
  652.  
Jun 28 '10 #5

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

Similar topics

2
5156
by: webstar | last post by:
How do you play wave files using java.applet.Applet?
1
4329
by: ochulus | last post by:
Hi! I'm new to Java and I would like to know how to manage files (e.g. rm, mv, mkdir, etc.) using Java for a simple text-based application on Unix. It's just an extension of a tutorial question at uni where we have to store bank customer details to a file. Thank you! pras
1
2503
by: Utada P.W. SIU | last post by:
Hi all professional I would like to know how to using java class file inside ASP page I have placed the class file to C:\WINNT\java\trustlib also, I have compiled it to 1.1 version but it always prompt error '800401e5' No object for moniker
10
1926
by: asj | last post by:
BIG news from the web services front. Amazon will use web services to tie all its vendors together. The company implementing the system will be using Java/C++ (migrating to all-java later). Isn't it funny how Microsoft spent so much touting .NET for web services, and J2EE is actually taking a bigger slice of the pie? ...
2
9211
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered problems doing this. I wanted to implemented a generic "Helper" class like this: /** * Helper
8
2376
by: dbaplusplus | last post by:
I worked on web development using java script many many years, so I am now a newbie to javascript. I have a single html page, which is generated dynamically using some programming language. Web page will be viewed using Microsoft's IE browser (version 6.x ....). Webapge is self-contained. i.e., it does not refer to any links outside the...
2
6633
by: asenthil | last post by:
i'm trying to read and write files using java... some errors occurs when i'm trying this code.. Error in java: Cannot find symbol location: class java.io.FileOutputStream FileOutputStream fout = new FileOutputStream(outputFile); ^ import java.io.*;
2
17422
by: asenthil | last post by:
Hai, i'm a beginner to java... just now i had tried to read and write files using java... and then i had tried to connect a database using jdbc... now i want to export the data's from a database into a text file
1
1450
by: aishswami | last post by:
Hi i face trouble in comparing two dates in loop using java scripts... give me suggestion abt the problem...
4
25816
by: BibhuAshish | last post by:
Hi, I wanted to delete a line from xml file which i did it. But after deletion of that line there is a blank space. Again if i am adding another line by using java that blank line remains as usual. My xml file is ::::::: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <config> <employee id = "1" name = "aa" /> ...
0
7784
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8031
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7795
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6424
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5294
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3735
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2223
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1309
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1044
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.