This will take some research on your part, and there are thousands of 
resources out there on the web. I would suggest using JQuery for this. 
Basically, user fills in their userid, hits a button (or something) that 
triggers the ajax call back to the server. On the server you have a CFC 
with a method to process the request. The ajax code on your page would 
have a 'success' handler that would put the info in the form once the 
request has completed properly.

Steve 'Cutter' Blades
Adobe Certified Expert
Advanced Macromedia ColdFusion MX 7 Developer
____________
http://blog.cutterscrossing.com


Co-Author "Learning Ext JS 3.2" Packt Publishing 2010
https://www.packtpub.com/learning-ext-js-3-2-for-building-dynamic-desktop-style-user-interfaces/book

"The best way to predict the future is to help create it"


On 3/2/2011 8:19 AM, Ian Vaughan wrote:
> Hi
>
> We are on CF7, not sure if this restricts the amount of functionality
> available to me?
>
> So how would it work - when a user types in their employee number in the
> text field how would ajax call a SQL query to lookup the data in the db
> table to populate the rest of the fields in the form.
>
> Do you have any code examples, as I am struggling to grasp how to
> implement this at the moment?
>
> Many Thanks
>
> -----Original Message-----
> From: Azadi Saryev [mailto:azadi.sar...@gmail.com]
> Sent: 02 March 2011 10:24
> To: cf-talk
> Subject: Re: Database Lookup - Possible with CF?
>
>
> It is definitely possible and rather easy using CF (or just plain
> javascript) - all you need to do is make an ajax request to a cfc/cfm on
>
> your server passing entered employee number as data/argument, which will
>
> return necessary data based on emp number. You then populate necessary
> fields with returned data.
> CF's built-in ajax functionality will come in handy here (i.e. cfinput
> fields with bind attribute pointing to your cfc method), but not
> required - same is easily achieved with a regular js ajax request;
> jQuery will even make it fun.
> If you are not very familiar with javascript, and you are running CF8+,
> then use the built-in cf functionality. All you need is well described
> in CF Developer's Guide (download pdf from adobe.com) and numerous
> blogs.
>
> Azadi
>
> On 02/03/2011 17:37 , Ian Vaughan wrote:
>> Hi
>>
>> I have created a web form, but what I would like it to do (and I'm not
>> sure if this is possible with Coldfusion?) is when a user enters their
>> employee number into a text field without a page refresh it runs a
>> database lookup and populates other fields in the form with that
>> employees information (name, address etc)
>>
>> Is this possible and is anybody willing to share any code snippets on
>> how to do this.
>>
>> I am getting pushed toward ASP.net for this but I am trying to fight
> the
>> corner of Coldfusion - so if I can deliver this app in Coldfusion it
>> would certainly help it's case so it would still be a viable
> development
>> option here.
>>
>> Many Thanks
>>
>>
>>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342669
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to