-2

我使用 2 个 div 元素作为 tabber

1)搜索候选

2)我的列表。在搜索候选人中,当我选择某个候选人时,该候选人被添加到 selected_candidate 表中并显示在我的列表 div 中,但是要在我的列表中显示它我必须重新加载整个页面,我如何在不重新加载的情况下显示它整页

<div class="tabber" style="width: auto;">
<div <?php if(isset($_POST['submita'])){ echo "class=\"tabbertab tabbertabhide\"";}else{echo "class=\"tabbertab\"";} ?>>
<h3>SEARCH CANDIDATE</h3> 
//.....select candidate code.....//
</div>
<div <?php if(isset($_POST['searchsel_list'])){ echo "class=\"tabbertab tabbertabdefault\"";}else{echo "class=\"tabbertab\"";} ?>>
<h3>MY LIST</h3>

<div id="tabr">
<script>
$("td").removeAttr("style");​
</script>

<form method="post" action="csearch.php?epage=csearch" name="mylist">
   <div class="CSSTableGenerator">
   <table id="mylist_remark">
   <caption>SELECTED CANDIDATE LIST</caption>
   <!-- headings -->
    <tr>
      <th>REMARK</th>
      <th> <input name="delete_sel" id="delete_sel" value="DELETE" type="submit" class="button"/></th>
      <th>NAME</th>
      <th>CELL NO</th>
      <th>STATUS</th>
      <th>EMAIL ID</th>
      <th>LOCATION</th>
      <th>QAULIFICATION INFORMATION</th>
      <th>KIND OF WORK</th>
      <th>DETAILED CV</th>
    </tr>
<!-- /headings -->

<?php
if($mresult_set)
    {
    if (mysql_num_rows($mresult_set) == 0)
    {
    echo "<tr>";
    echo "<td colspan=\"9\" ><p align=\"center\" class=\"message\"> <blink><span style=\"color:red;\" > NO CANDIDATE SELECTED</span></blink></p></td>";
    echo "</tr>";
    }

$j=0;
while($data_set1 = mysql_fetch_array($mresult_set))
    {  
        // $i=0;            
         if($data_set1['ca']=='')
         {
           $qua="";
         }
         else
         {
           $qua=$data_set1['ca'];
         }
         if($data_set1['cs']=='')
         {
           $qua="";
         }
         else
         {
           $qua.=",".$data_set1['cs'];
         }
         if($data_set1['cwa']=='')
         {
           $qua.="";
         }
         else
         {
           $qua.=",".$data_set1['cwa'];
         }
         if($data_set1['completed']=='')
         {
           $qua.="";
         }
         else
         {
         $qua.=", Completed(".$data_set1['completed'].")";
         }
         if($data_set1['persuing']=='')
         {
           $qua.="";
         }
         else
         {
           $qua.=", Persuing(".$data_set1['persuing'].")";
         }

        echo "<tr  >";
        echo "<td><input id={remark{$j}} type=\"text\" class=\"fancyText\" onkeyup=\"writeremark(this.id,{$data_set1['eid']},{$emprid});\" value=\"{$data_set1['remark']}\" maxlength=\"15\" placeholder=\"Write Remark\" /></td>";
        echo "<td style=\"text-align:center;\"><input id=\"listrow_sel{$j}\"  type=\"checkbox\" name=\"list_sel[]\" value=\"{$data_set1['eid']}|{$emprid}\" /></td>";
        echo "<td>{$data_set1['ename']} {$data_set1['lname']}</td>";
        echo "<td>{$data_set1['ecell']}</td>";
        echo "<td>{$data_set1['eposition']}</td>";
        echo "<td>{$data_set1['eemail']}</td>";
        if($data_set1['ecity']=='')
        {
        echo "<td>{$data_set1['ecountry']}</td>";
        }
        else
        {
        echo "<td class=\"showmsg\" title=\"Country ={$data_set1['ecountry']}, State = {$data_set1['estate']} \" >{$data_set1['ecity']}</td>";
        }

       // echo "<td>{$data_set['ecountry']},{$data_set['estate']},{$data_set['ecity']}</td>";
        echo "<td>{$qua}</td>";

        echo "<td>{$data_set1['other_work1']} {$data_set1['other_work2']}{$data_set1['other_work3']}{$data_set1['other_work4']} {$data_set1['other_work5']} {$data_set1['other_work6']} {$data_set1['other_work7']} {$data_set1['other_work8']} {$data_set1['other_work9']} {$data_set1['other_work10']}{$data_set1['other_work1e']} {$data_set1['other_work2e']} {$data_set1['other_work3e']} {$data_set1['other_work4e']} {$data_set1['other_work5e']} {$data_set1['other_work6e']} {$data_set1['other_work7e']} {$data_set1['other_work8e']} {$data_set1['other_work9e']} {$data_set1['other_work10e']}</td>";
        echo "<td><a style=\"cursor:hand;\"  href=\"detailcv.php?id={$data_set1['eid']}&flag=0\" target=\"_blank\" ><input style=\"cursor:auto;width:40px;\"  class=\"button\" name=\"cv\" type=\"button\" value=\"C V\" /></a></td>";              

        //echo "<td class=\"edit\" contenteditable=\"true\">Write Remark</td>";
        echo "</tr>";
        $j++;                       
        }
    }
?>
 <tr><td  colspan="10">
 <a href="<?php echo $listurl;?>"><img src="images/pdfdown.jpg" alt="Adobe Doc" width="42" height="42" title="Download List In PDF"/></a>&nbsp&nbsp&nbsp
  <a id="showcand" href="<?php echo $listurl1;?>"><img src="images/excel.gif" alt="Excel Doc" width="42" height="42" title="Download List In Excel "/></a>
 <?php  ?>
 </td></tr>
</table></div>
</form>
</div>

显示标签

在这张图片中,我正在显示 tabber,当我点击我的列表时,我可以在不加载整个页面的情况下加载它的表单,以便选中的候选人可见,我知道可以使用 Ajax 来完成,但我不知道如何我可以在我的代码中做到这一点

4

1 回答 1

0

你可以在ajax的帮助下做。为此,您必须对要添加到列表中的选定候选人调用 ajax 函数。

ajax函数演示如下:

函数获取列表(){

$.ajax({
type: "POST",
url: "List.php", // file where you process the list.
data: {name:name1,sda:name2}, // post data you want to pass to the file for processing
success:function(data){

    //change the content of your mylist div here
}

});
}

你可以试试看。

于 2013-04-27T09:04:34.437 回答