Пожалуйста, сообщите, как добиться этого, скройте таблицу html innter при загрузке страницы и нажмите кнопку поиска, таблица будет отображаться только с результатами. Я не хочу показывать пустую таблицу. Пожалуйста, просмотрите приведенный ниже код, который я пробовал.
Но, конечно, после щелчка на кнопке страница обновляется.
$(document).ready(function() {
$("#historylist").hide();
$("#historysearch").click(function() {
$("#historylist").show();
});
// }
});
<table id="searchTbl" width="800" >
<tr>
<td valign="top">Release No</td>
<td valign="top">
<input type="text" name="releaseNo" value="" style="width:200" />
</td>
<td valign="top"><input type="button" value="Search" onClick="commit()" style="width:80" id="historysearch"/></td>
</tr>
<br /><br />
<table border="1" cellpadding="2" cellspacing="0" id="historylist">
<tr>
<th><font size="-1">Header1</font></th>
<th><font size="-1">Header2</font></th>
<th><font size="-1">Header3</font></th>
<th><font size="-1">Header4</font></th>
<th><font size="-1">Header5</font></th>
</tr>
</table>
</table>
JavaScript:
function commit(){
document.menu.cmd.value='search';
document.menu.submit();
}
Когда вы нажимаете кнопку, она показывает таблицу и снова скрывает таблицу.
$(document).ready(function() {
$("#historylist").hide();
$("#historysearch").click(function(e) {
e.preventDefault();
$("#historylist").show();
commit(); // moved from the onClick attribute });
});
$("#historysearch").click(function(e) {
e.preventDefault();
$("#historylist").show();
commit(); // moved from the onClick attribute
});