Hi! My page does not redirect to "userReport_Asset.php" when i click the submit button. what happens is that when i choose an item, it is not shown yet in the drop down menu. when i click submit, it prints the item selected (i print the values to see if it really gets the value), nothing happens. and when i click submit again, the item chosen is printed but it is still not redirected to "userReport_Asset.php". what should i do? thanks!

<?php
session_start();
    if(!session_is_registered(myusername)){
        header("Location:main_login.php");
    }
?>
<html>
<head>

<title>Employee</title>

<style type="text/css">
<!--
.tableHead {
    font-family: "Myriad Pro Light", "Myriad Pro";
    font-size: 17px;
    font-style: normal;
    font-weight: bold;
    color: #FFF;
}
.tableHead1 {
    font-family: "Myriad Pro Light", "Myriad Pro";
    font-size: 15px;
    font-style: normal;
    font-weight: bold;
    color: #346198;
}
.tableHead2 {
    font-family: "Myriad Pro Light", "Myriad Pro";
    font-size: 14px;
    font-style: normal;
    font-weight: bold;
    color: #FFF;

}
.tableContent {
    font-family:Euphemia;
    font-size: 13px;
    font-style: normal;
    color: #000;
}
-->
</style>


<script type="text/javascript">

function confSubmit(form) {
    if (confirm("Are you sure you want to send this report?")) {
        window.location("userMy_Asset.php")
    } else {
        alert("You decided to not submit the report!");
        window.location("mainUser.php")
    }
}

function reload(form){
    var val=form.cat.options[form.cat.options.selectedIndex].value; 
    self.location='dd.php?cat=' + val ;
}
</script>
</script>

</head>



<body> 
<table width="914" height="154" border="0">
  <tr>
    <td width="840" height="23" colspan="5" bgcolor="#346198" class="tableHead">Report Asset</td>
  </tr>
  <tr>
    <td height="12" colspan="5"></td>
  </tr>
  <form action="userReport_Asset.php" method="post">
  <tr>
    <td height="83" colspan="5"><table width="501" height="115" order="0" style="text-align: center; font-weight: normal; border-collapse:collapse; border:1px solid #346198" cellpadding="3" cellspacing="3">
      <tr>
        <td height="21" colspan="3" class="heading4" bgcolor="#346198"><div align="left" class="tableHead">Create New Ticket</div></td>
      </tr>
      <tr>
        <td width="84" height="27" class="heading4"><div align="left">Category:</div></td>
        <td width="148"><div align="left">
          <select name="category" onChange="submit()">
            <option>Select a category</option>
            <option value="Hardware">Hardware</option>
            <option value="Software">Software</option>
          </select>
        </div></td>
            <?php
                //include "..\configdb.php";
                //include "..\opendb.php";

                echo "Category is: ".$_POST['category'];
                echo "Control Number is: ".$_POST['assetId'];

                //include "..\closedb.php";
            ?>
      </tr>
      <tr>
        <td height="11" class="heading4"><div align="left">Problem:</div></td>
        <td colspan="2" rowspan="2"><div align="left"><textarea name="problem" cols="45" rows="3"></textarea></div></td>
      </tr>
      <tr>
        <td height="11" class="heading4">&nbsp;</td>
      </tr>
    </table>
  </td>
  </tr>
  </form>
    <form action="userReport_Asset.php">
    <tr>
      <td width="64" height="26" class="heading4">
      <input type="submit" name="submit" value="Submit">
      </td>
    </tr>
    </form>
</table>
</body>
</html>

Why there is two form tag????
Use only once after <body><form...> and complete it before</form></body>

And --> <select name="category" onChange="submit()">
What is need of onChange submit???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.