Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
80
rated 0 times [  87] [ 7]  / answers: 1 / hits: 6967  / 10 Years ago, wed, april 30, 2014, 12:00:00

hello I have a button search and I want when pressing enter make my search for the moment its work when onclick . 1) Can i HAve both ? 2) how do I do this correctly? Here my code



<script type=text/javascript src=http://www.jeasyui.com/easyui/jquery.easyui.min.js></script>
<script type=text/javascript>
function doSearch(){
$('#tt').datagrid('load',{
proNum: $('#proNum').val(),
proName: $('#proName').val(),
proCliId: $('#proCliId').val()
});
}
function doSearch1(){
if (e.keyCode == 13 || e.which == 13){
$('#tt').datagrid('load',{
proNum: $('#proNum').val(),
proName: $('#proName').val(),
proCliId: $('#proCliId').val()
});
}
}
</script>
</head>
<body>



<table id=tt class=easyui-datagrid style=width:700px;height:500px
url=getdata.php
title=Searching iconCls=icon-search toolbar=#tb
rownumbers=true pagination=true>
<thead>

</thead>
</table>
<div id=tb style=padding:3px>
<span>Entrer un chiffre ou une lettre pour débuter la recherche:</span>
<input id=proNum style=line-height:26px;border:1px solid #ccc>
<a href=# onkeypress=doSearch1() class=easyui-linkbutton plain=true onclick=doSearch()>Search</a>
</div>
</body>
</html>

More From » php

 Answers
9
    function doSearch1(e){
if (e.keyCode == 13){
$('#tt').datagrid('load',{
proNum: $('#proNum').val(),
proName: $('#proName').val(),
proCliId: $('#proCliId').val()
});
}

[#45638] Tuesday, April 29, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
alorac

Total Points: 262
Total Questions: 82
Total Answers: 97

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
alorac questions
Sat, Oct 10, 20, 00:00, 4 Years ago
Tue, Sep 22, 20, 00:00, 4 Years ago
Wed, Jul 1, 20, 00:00, 4 Years ago
Wed, Jun 3, 20, 00:00, 4 Years ago
Sun, May 17, 20, 00:00, 4 Years ago
;