我在這裏迷路了,需要建議。我的情況:與如下因素代碼更改默認項限制模塊:添加其他過濾器時保存限制更改
<form method="get" style="text-align:center;">
<input type="hidden" name="lastrecepes" value="">
<button type="submit" value="24" id="limit" name="limit" onclick="change();" style="width:200px;margin:20px 0 20px 0;"/>change limit</button>
<script>
function change(){
var elem = document.getElementById("limit");
if (elem.value=="24") elem.value = "36";}
</script>
</form>
helper.php:
public static function getLists(&$params)
{
$total_items = ($_GET['limit']) ? $_GET['limit'] : $params->get('count');
if ($_GET['limit']) $params->set('count',$_GET['limit']);
$content_source = $params->get('content_source','joomla');
}
我的鏈接更改爲:HTTP:* /項目/ lastrecepes = &限制= 36 和它的作品,但是當我嘗試像添加其他過濾器:
<button type="submit" value="0" id="skip_items" name="skip_items" onclick="change1();" style="width:200px;margin:20px 0 20px 0;"/>more</button><script>
function change1(){
var elem = document.getElementById("skip_items");
if (elem.value=="0") elem.value = "15";}
</script>
它改變限制OL d值,URL是這樣的:HTTP:* /項目/ lastrecepes = & skip_items = 15
如果我手動添加這些他們一起工作得很好:HTTP:* /項目/ lastrecepes = &限制= 36 & skip_items = 15
任何人都可以幫助我,我喜歡在另一個過濾器進來時保存第一個過濾結果。對不起,我的英語不好,希望你能理解我。
難道這會很難嗎? no1知道?! –