Drupal 6.x module dev, form help please.

Discussion in 'Programming' started by DaveLowe, Oct 7, 2008.

  1. #1
    I really hope someone on here can help me with my drupal problem.

    I'm having a go at developing a custom application/module and want to have my own search page, but I'm really struggling to get it to do what I want (which might not even be possible with drupal.)

    Basically I would like a page with a single box which will allow a user to search some database records, I can get the form to post and access the database fine its the display afterwards which is an issue.

    When the user submits the form I want the page to display the original form again (so they could potentially do a new search) and below that display a table of the results (if there are any results)

    This would be fairly simple in php but I'm struggling to work out how to pass information back to the page with the _submit hook I only seen to be able to send a message back with drupal_set_message().

    I have worked out I could redirect the user to a new page with the search term in the address bar (e.g. mymodule/search/results/%) but this would become complicated if I decided to extend the form.

    Can anyone help please?
     
    DaveLowe, Oct 7, 2008 IP