php - 动态设置样式和输入值

I have problem with my form. This form is used for search through DB and it has two parts, one is visible and one is expanded by click (it's advanced search).

The problem is, that when I proceed with search and get results the container will hide anyway and the value is not viewed in the input.

But that happened only if I use "RCD ID", when I search for "Place" everything is working just fine. I don't know what I missed.

Bellow are some examples of the code, if needed, I can provide more

Thanks for help

<form name=s style="display: inline; margin: 0px;" action="<?= $_SERVER['PHP_SELF']?>" method=get autocomplete="off">
<table>
<tr><td>Some inputs..</td></tr> 

Below it's logic for expanding the container

//expanded search 

<a href="#" class=navig-advanced onclick="if (document.getElementById('advanced').style.display == 'none') document.getElementById('advanced').style.display='block'; else document.getElementById('advanced').style.display='none'; return false;"><img src="img\icon_select.png" align=absmiddle hspace=0 border=0>&nbsp;&nbsp;advanced search</a>
<?
if ($searchpar['tel'] || $searchpar['fce'] || $searchpar['diviz'] || $searchpar['pracus'] || $searchpar['res'] || $searchpar['mist'] || $searchpar['rcd_id'] || $searchpar['rx4_id'] || $searchpar['ns']) $disp = 'block';
  else $disp = 'none';
?>
<div id=advanced style="display: <?= $disp ?>; width: 201px;" class=tabcontent-search>
<table class=navig-table>

Here are some inputs, the first one is working, the second one is not

//then the input

<tr><td>Place:</td><td><input type=text class=navig-tabinput name=mist value="<?= $searchpar['mist']?>" id=mist <?= $_COOKIE['nosugg'] == 'yes' ? '' : " onkeyup=\"findNames('mist', 'popup8', 'table8', 'tbody8', 'closeimg8', 'load8', '', '', '');\" onkeydown=\"return catchkey(event);\" " ?>><img id=load8 style="visibility: hidden;" src="img/wait-e5effa.gif" alt="loading" border=0 hspace=2 vspace=0 align=absmiddle>
  <div id="popup8" class="suggest-div">
    <table id="table8" class="suggest-tab">
        <tbody id="tbody8"></tbody>
    </table>
      <img src="img\dash.png" hspace=0 vspace=2><br>&nbsp;<a class=suggest-link alt="don't use suggestions" href="?mode=nosugg&backmode=<?= $mode ?>">turn off suggestion</a>&nbsp;<a class=suggest-link href="#" onclick="document.getElementById('popup8').style.display='none'; return false;"><img id="closeimg8" style="position: absolute; left: 112px;" src="img\close.png" border=0 alt="close window"></a>
    </div>
</td></tr>
<tr><td><span class=help title="RCD ID">RCD ID:</span></td><td><input type=text class=navig-tabinput name=rcd_id value="<?= $searchpar['rcd_id']?>" id=rcd_id <?= $_COOKIE['nosugg'] == 'yes' ? '' : " onkeyup=\"findNames('rcd_id', 'popup9', 'table9', 'tbody9', 'closeimg9', 'load9', '', '', '');\" onkeydown=\"return catchkey(event);\" " ?>><img id=load9 style="visibility: hidden;" src="img/wait-e5effa.gif" alt="loading" border=0 hspace=2 vspace=0 align=absmiddle>
  <div id="popup9" class="suggest-div">
    <table id="table9" class="suggest-tab">
        <tbody id="tbody9"></tbody>
    </table>
       <img src="img\dash.png" hspace=0 vspace=2><br>&nbsp;<a class=suggest-link alt="don't use suggestion" href="?mode=nosugg&backmode=">turn off suggestion</a>&nbsp;<a class=suggest-link href="#" onclick="document.getElementById('popup9').style.display='none'; return false;"><img id="closeimg9" style="position: absolute; left: 112px;" src="img\close.png" border=0 alt="close window"></a>
    </div>
</td></tr>

My first impression is that you are trying to hide elements that having the ID advanced. But with HTML only one element on the page can have the same ID. Try to use libraries like jQuery where you can pinpoint the closest element to hide when clicking a button near it.

Last but not least: do not use tables for forms. Just use styled <div>'s. And also use CSS rather than using the style key.