Hello,

Sorry if the request may sound dumb, but here it is.

I want to add a search function to my website which would retrieve data from a DB. Also, I would like to make two inputs (two search fields) and I would like to get the results automatically after filling the second input (search field).

Here is an example of what I want to implement. Check out http://fany.ro
You can see in the upper part, on the right side, there are two inputs. One is Localitatea de plecare and the other one is Localitarea de sosire. Fill in Localitatea de plecare with Oradea, and fill in Localitatea de sosire with Sacuieni. After you will fill the second field, you will be redirected automatically to the results page.

I'm not quite in the scripting area, though I have some knowledge, but I am only a beginner. I have searched the web for a tutorial or something like that which would explain a search type like this with two inputs and the other feature with the automatic search (redirection to the search results). However didn't find any info and I've been searching for hours.

I have the two .js files of the above script but I don't know how to make the required connections. Help would be greatly appreciated.

Here is the .js file for Localitatea de plecare:
http://pastebin.com/MsdCBPdB

and here is the .js file for Localitatea de sosire
http://pastebin.com/7iBBs1Wt