Joomla 2.5 form redirection error

放肆的年华 提交于 2019-12-24 15:11:15

问题


Here is my form

<form name="form1" action="<?php echo JRoute::_('index.php?option=com_mycomponent&task=search')?>" method="get">            
<input id="search_key" name="searchword" type="text" class="inputbox" placeholder="Enter Keyword/Part Number..." autocomplete="off">
<input type="submit" class="inputbutton" value="Search">
</form>  

After entering any keyword say 'test', it redirects to index.php?searchword=test

But i need to redirect it to index.php?option=com_mycomponent&task=search&searchword=test

it is not working either in sef enabled/disabled

when i type index.php?option=com_mycomponent&task=search&searchword=test in url, i go to the desired page.

Please tell me where am i wrong


回答1:


Can you try changing:

<form name="form1" action="<?php echo JRoute::_('index.php')?>" method="get">

to

<form name="form1" action="<?php echo JRoute::_('index.php')?>" method="get">
<input type="hidden" name="option" value="com_mycomponent">
<input type="hidden" name="task" value="search">


来源:https://stackoverflow.com/questions/18959813/joomla-2-5-form-redirection-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!