Hi there! I hope you can help me out please.
I have a private messaging system we custom coded, and to select who the message is addressed to we have a select menu with a list of all users names which we fetch from mysql via PHP.
This works, but is a really messy option.
I was wondering if anyone has a solution such of this that they could possibly share? I would also need it to only allow 10 selections max (although we do check this with PHP too). A perfect example of this is the facebook private messaging thing, where it lets you put the names you want to send the message to in one box.
Hope this makes sense, and looking forward to your reply. I will really appreciate any help.
Any ideas? Thank you
Another way you could do it is to use AJAX to get your name suggestions.
Maybe something like the following:
1) set up an input textbox in which the user can type parts of a name.
2) set up a select list whose options will be populated by the returned response from an ajax function.
3) set up a button labled something like "Get names" that when clicked will run an ajax function.
4) The Ajax function would send the current value in the textbox to a php script to query the db for names containing the textbox value.
and then use the returned results to write your <options> and return them to the browser in the select list
$seed = $_POST['txtValue'];
$query = 'select fldName from tblUsers where fldName like "'.$seed.'"';
Anyway, just food for thought...
Last edited by tirna; 04-18-2010 at 02:11 AM.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)