From: "Ernie Kemp" on 11 Apr 2010 20:16 Simple idea I thought. I need a webpage that displays a drop down list of number with a checkbox on the side that when checked will select the database again only in descending order. Small database with maybe 100 records. The user can click the submit button when they have located the correct number. The trick is to make the checkbox trigger a new Select statement. Thanks.
From: kranthi on 11 Apr 2010 21:17 You can use javascript to trigger an onclick function every time a checkbox is selected. The onclick function can make an ajax call to a remote php script which can then make the database query.
From: Nilesh Govindarajan on 11 Apr 2010 21:58 On 04/12/10 05:46, Ernie Kemp wrote: > Simple idea I thought. > > I need a webpage that displays a drop down list of number with a > checkbox on the side that when checked will select the database again > only in descending order. > > Small database with maybe 100 records. > > The user can click the submit button when they have located the correct > number. > > The trick is to make the checkbox trigger a new Select statement. > > Thanks. > Use jquery, trigger an ajax request onclick of that checkbox. -- Nilesh Govindarajan Site & Server Administrator www.itech7.com मेरा भारत महान ! मम भारत: महत्तम भवतु !
From: tedd on 12 Apr 2010 10:18 At 8:16 PM -0400 4/11/10, Ernie Kemp wrote: >Simple idea I thought. > >I need a webpage that displays a drop down list of number with a >checkbox on the side that when checked will select the database >again only in descending order. >Small database with maybe 100 records. > >The user can click the submit button when they have located the >correct number. > >The trick is to make the checkbox trigger a new Select statement. > >Thanks. Ernie: <form name="myForm" action="" > <input type="checkbox" name="sort" id="sort" onClick="getData(this)" > </form> The javascript getData() will have to launch a php script to get the data again OR you can simply sort the data yourself using sort(). Here's another idea using jQuery: http://webbytedd.com/jquery/sortable-table/ Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com
From: "Ernie Kemp" on 14 Apr 2010 13:27 Thanks for your thoughts. Ajax is the way to go... Thanks, ..../Ernie -----Original Message----- From: tedd [mailto:tedd.sperling(a)gmail.com] Sent: April-12-10 10:18 AM To: Ernie Kemp; 'PHP General List' Subject: Re: [PHP] PHP & MYSQL sorting At 8:16 PM -0400 4/11/10, Ernie Kemp wrote: >Simple idea I thought. > >I need a webpage that displays a drop down list of number with a >checkbox on the side that when checked will select the database >again only in descending order. >Small database with maybe 100 records. > >The user can click the submit button when they have located the >correct number. > >The trick is to make the checkbox trigger a new Select statement. > >Thanks. Ernie: <form name="myForm" action="" > <input type="checkbox" name="sort" id="sort" onClick="getData(this)" > </form> The javascript getData() will have to launch a php script to get the data again OR you can simply sort the data yourself using sort(). Here's another idea using jQuery: http://webbytedd.com/jquery/sortable-table/ Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.801 / Virus Database: 271.1.1/2806 - Release Date: 04/12/10 02:32:00
|
Pages: 1 Prev: need help w/ unfamiliar syntax Next: Saving form data into session before leaving a page |