This topic is locked

How to retrieve Search box field value

7/2/2007 10:57:08 AM
PHPRunner General questions
C
ccuser author

I want to be able to retrieve the value from the Search box on the list page and append in to the add page...
For example:

If list page Search= "Mouse"

Then I want the Add Record link on that page to be: page_add.php?Search=Mouse
Is there any way to do this?

J
Jane 7/3/2007

Hi,
you can do the following:

  • swith to HTML mode on the Visual Editor tab
  • find this code:
    <A class=toplinks href="products_add.php">Add new</A>

and replace it with this one:

<A class=toplinks href="products_add.php?search={$searchaddlink}">Add new</A>


  • then proceed to the Events tab and add this code to the List page: Before process event:
    global $smarty;

    if (@$_REQUEST["a"]=="search")

    $smarty->assign("searchaddlink",@$_REQUEST["SearchFor"]);