Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: How can I add multiple forms in one?  (Read 134 times)

sibas

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 451
    • www.simply4all.net
How can I add multiple forms in one?
« on: February 23, 2013, 07:18:06 PM »

Hi there, I have stuck with the following!
I have 2 different forms to search names, and cities, so except the function search() I have function search_names() and function search_city()

Now my problem is that I don't want to have 3 different forms and I don't want to use ajax, I want to have one and with some option stuff to change to the right function.

Is there any idea how to make work this!
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: How can I add multiple forms in one?
« Reply #1 on: February 24, 2013, 01:22:30 PM »

Set form up with radio buttons.
One for names.
One for city.
(obviously a field for your search query is also required)

When form entered, use the activated radio to direct search query to the relevant function.
Logged
Of all the things I have lost, it is my mind that I miss the most.

sibas

  • Sr. Member
  • ****
  • Karma: 23
  • Posts: 451
    • www.simply4all.net
Re: How can I add multiple forms in one?
« Reply #2 on: March 01, 2013, 06:02:40 PM »

Hey philmoz thanks for your answer
finally I decided to use those forms in 3 different pages  :)
Logged