简体   繁体   中英

Joomla 2.5 form redirection error

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

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">

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM