Page 1 of 1

Getting values from database depending on user selected Radio Button

Posted: Mon Aug 12, 2013 8:32 pm
by Chris Whitfield

Each item in my database has driving times from two destinations

Looks like this:

ItemName DistanceFromDestination1 DistanceFromDestination2

MBJ Airprort 30 minutes 60 minutes
KNG Airport 45 minutes 90 minutes

My users can select which destination they are in from a radio button. It stores a local variable and does a sorting query which orders the airports based upon closest distance.

Now, I want that depending on which destination they select they are in, we present the actual value to them on the search results page within the list.

For Example, if they selected they were in "destinatoin 1" the results would be ordered with the actual value next to it: like so:

MBJ Airport 30 minutes
KNG Airport 45 minutes

I suppose, how do I let appery know to along show driving distance for each airport based on the radio button the user selected on the previous page.

Thanks!


Getting values from database depending on user selected Radio Button

Posted: Mon Aug 12, 2013 10:06 pm
by maxkatz

You want to do a database search (query) to get data for a particular item name?


Getting values from database depending on user selected Radio Button

Posted: Mon Aug 12, 2013 10:15 pm
by Chris Whitfield

Correct, depending on which destination the user selected in the radio button list.


Getting values from database depending on user selected Radio Button

Posted: Mon Aug 12, 2013 10:36 pm
by maxkatz

You could search the collection. There are two tutorials that how how to do that here: http://docs.appery.io/tutorials/#Appe...

You can also check the docs for more options: http://docs.appery.io/documentation/b...