if search by textbox is working jumpmenu not working
but jumpmenu is working, textbox is not working

help me please!!

<table width="100%" border="0"  align="center" cellpadding="3" cellspacing="1">
  <tr>
  <td width="518" style="font-size:16px; font-weight:bold;">รายชื่อผู้สมัครงานทั้งหมด</td>
  <td width="167" align="right">

 <!-- <form action="position_add.php" method="get" name="add">
<div align="center"><input name="" type="submit" value="add" style="cursor:pointer;" /></div>
</form>-->
  </td>
  </tr>
  <tr>
    <td style="font-size:16px; font-weight:bold;">&nbsp;</td>
    <td align="right">&nbsp;</td>
  </tr>
  <tr>
    <td style="font-size:16px; font-weight:bold;"><form name="frmSearch" method="get" action="<?php echo $_SERVER['SCRIPT_NAME'];?>" onSubmit="return validate();">
ค้นหาจาก ชื่อ-สกุล
      <input name="txtKeyword" size="30" type="text" id="txtKeyword" value="<?=$_GET["txtKeyword"];?>" >
      <input type="submit" name="imageField" id="imageField" value="ค้นหา"  />
    </form>

 <form method="get" action="<?php echo $objResult["positionID"];?>">
<select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('parent',this,0)">
<option  value="">----แสดงข้อมูลในฐานข้อมูล--------</option>
<?php
$strSQL ="SELECT * FROM position order by positionID";
$objQuery = mysql_query($strSQL);
while($objResult = mysql_fetch_array($objQuery)){
?>
<option value="apply_all2.php?positionID=<?php echo $objResult["positionID"];?>"  <?php if ($_GET["jumpMenu"] ==$_GET ["positionID"]) {echo'selected="selected" ';}?>><?php echo $objResult["position_name"];?></option>


<?php
}
?>
</select>



</form>

    </td>
    <td align="right">&nbsp;</td>
  </tr>
</table>

<?php
//
if($_GET["txtKeyword"] != ""){
    $strSQL ="  SELECT * FROM application WHERE name LIKE '%".$_GET["txtKeyword"]."%' ";
}else if($_GET["txtKeyword"] == ""){
    $strSQL ="  SELECT * FROM application ";
}
//else if($_POST["jumpMenu"] ==$objResult["positionID"]){
//  $strSQL ="  SELECT * FROM application a LEFT JOIN position b ON (a.positionID=b.positionID) WHERE a.positionID = '".$_GET ["positionID"]."' ";
//}else if($_POST["jumpMenu"] == ""){
//  $strSQL ="  SELECT * FROM application ";
//}


if($_GET["jumpMenu"] ==$objResult["positionID"]){
    $strSQL ="  SELECT * FROM application a LEFT JOIN position b ON (a.positionID=b.positionID) WHERE a.positionID = '".$_GET ["positionID"]."' ";

}
elseif($_GET["jumpMenu"] ==""){
    $strSQL ="  SELECT * FROM application";

}

//
// else if($_POST["jumpMenu"] ==""){
//  $strSQL ="  SELECT * FROM application ";
//}

//$strSQL ="SELECT * from application a left join position b on a.positionID=b.positionID where a.positionID='".$_GET ["positionID"]."' ";

$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery);
$Num_Rows = mysql_num_rows($objQuery);

$Per_Page = 10;   // Per Page

$Page = $_GET["Page"];
if(!$_GET["Page"]){
    $Page=1;
}

$Prev_Page = $Page-1;
$Next_Page = $Page+1;

$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page){
    $Num_Pages =1;
}else if(($Num_Rows % $Per_Page)==0){
    $Num_Pages =($Num_Rows/$Per_Page) ;
}else{
    $Num_Pages =($Num_Rows/$Per_Page)+1;
    $Num_Pages = (int)$Num_Pages;
}
/*
    Order By = Incorrect
    ORDER BY = Correct
*/
$strSQL .=" ORDER BY appID DESC LIMIT $Page_Start , $Per_Page ";
$objQuery  = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>

<table width="100%" border="0" class="tbshow" bgcolor="#ccc" align="center" cellpadding="5" cellspacing="1">
  <tr>
    <td width="50" class="tbshowtr"><div>ลำดับ</div></td>
    <td width="250" class="tbshowtr"><div>ชื่อ-สกุล</div></td>   
    <td width="250" class="tbshowtr"><div>ตำแหน่ง</div></td>
    <td width="150" class="tbshowtr"><div>วันที่สมัคร</div></td>
    <td width="100" class="tbshowtr"><div>ดูใบสมัคร</div></td>
    <td width="100" class="tbshowtr"><div>เอกสาร</div></td>
  </tr>

<?php
$i=1;
if($Page > 1){
    $i = ($Per_Page * ($Page-1)) + 1; 
}

while($objResult = mysql_fetch_array($objQuery)){
?>
<tr bgcolor="#fff">
<td><div align="center"><?php echo $i;?></div></td>
<td align="center"><?php echo $objResult["name"];?></td>
<td align="center"><?php echo $objResult["positionName"];?></td>
<td align="center"><?php echo $objResult["Creatdate"];?></td>
<td align="center"><a href="apply_detail.php?appID=<?php echo $objResult["appID"];?>"><img src="../../images/view_icon.png" border="0"></a></td>
<td align="center"><a href="../../file/<?php echo $objResult["resume"];?>"><img src="../../images/dl_icon.png" border="0"></a></td>
</tr>
<?php
$i++;
}
?>
</table>
Member Avatar for diafol

Hi. Before anything else, I think you should work on your workflow of not mixing html and php. That is extremely difficult to follow. Beyond my abilities, sorry.

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.