TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 07-30-2009, 05:28 PM   #1 (permalink)
The Wanderer
 
Join Date: Feb 2008
Posts: 13
Thanks: 3
gillweb is on a distinguished road
Help Help with AutoComplete...

I am using this script for an auto completer on a project of mine. I have it working perfectly for me BUT i can't get it to also 'auto complete' an ID into a hidden field in my form.

What i need it to do is not only put the 'name' in the text box but also the corresponding ID from the database into a hidden form field. Can someone help me or point me into a direction here?

Thanks.
gillweb is offline  
Reply With Quote
Old 07-30-2009, 08:43 PM   #2 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Smile

Hi,

Did you update the PHP file?

PHP Code:
$query $db->query("SELECT value FROM countries WHERE value LIKE ‘$queryString%’ LIMIT 10"); 
to

PHP Code:
$query $db->query("SELECT value,id FROM countries WHERE value LIKE ‘$queryString%’ LIMIT 10"); 
Then it looks like you need to update this part to:
PHP Code:
echo &#8216;<li onclick="fill(’‘.$result->value.’‘);">’.$result->value.‘</li>’;
            

to something with ID in it. I am not sure how you are making it work.

Does that helP?

MODNOTE: please use tags that are meant for php. Thank you,
__________________
SkiLeases.com

Last edited by codefreek : 07-31-2009 at 01:31 PM. Reason: PHP tags added - please read http://www.talkphp.com/lounge/4563-prettifying-pasted-code-talkphp.html
buildakicker is offline  
Reply With Quote
The Following User Says Thank You to buildakicker For This Useful Post:
gillweb (07-31-2009)
Old 07-31-2009, 12:54 PM   #3 (permalink)
The Wanderer
 
Join Date: Feb 2008
Posts: 13
Thanks: 3
gillweb is on a distinguished road
Default

well i'm not sure if that helps... sounds like it puts me into a direction so I'll have to play with it and report back
gillweb is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 08:11 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design