Re: [jQuery] jQuery + ColdFusion - auto complete examples?
Here's a quick example: http://www.co-opcookbook.com/test.cfm It's not working 100% right now, I think due to the way mySQL stores the data (extra carriage returns at the end maybe). But here's the code for it (note, this uses an older version of jQuery). I haven't take the time to update this example page. Here's TEST.cfm the recipe MANAGER function selectItem(li) { if (li.extra) { $('#fk_ing_id').val(li.extra); } } function formatItem(row) { return row[0]; } $(document).ready(function() { var curID = 0; $("#ingredient").autocomplete("search.cfm", { minChars:1, matchSubset:1, matchContains:1, cacheLength:10, onItemSelect:selectItem, formatItem:formatItem, selectOnly:1 }); $('#saveandadd').click( function() { curID++; // get value from quanty drop downs var whole = $('#wQty').val(); var fraction = $('#fQty').val(); var qty = parseInt(whole) + (fraction*1); var unitID = $('#unit').val(); var unitText = $('#unit option:selected').text(); alert(unitText); var ing = $('#ingredient').val(); // duplicate the template row $('#template').clone().id(curID).appendTo('#ingHeader').removeClass('hideMe' ); // set the values $('#' + curID).html(qty + ' ' + unitText + ' ' + ing) }) }); SELECT * FROM r_unit ORDER BY recunit_name SELECT * FROM r_fractions WHERE numerator != 0 ORDER BY value Ingredient Entry -- #q# (and -- #numerator#/#denominator# ) #recunit_name# Ingredient Data And here's search.cfm SELECT * FROM r_ingredients WHERE rec_list_ingredient LIKE #rec_list_ingredient#|#rec_list_id# -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Priest, James (NIH/NIEHS) [C] Sent: Monday, February 26, 2007 8:32 AM To: jQuery Discussion. Subject: [jQuery] jQuery + ColdFusion - auto complete examples? I'm working on an administration tool and I'd like to use jQuery to populate a user field - IE the user would type in a few letters of the last name and have it find the matching names... I know there are lots of ColdFusion folks on the list - I'm looking for some examples :) I've used jQuery quite a bit in the rest of this application but it's all been for display/UI - no Ajax - so now I want to give that a try. Thanks! Jim ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
Wow. This is very nice. And fast. Thank you! Rey Bango wrote: > James!!! Welcome bud. I see you posting on my blog all of the time. Glad > to see you came on over to jQuery. > > For autocomplete functionality, I've sued this one successfully: > > http://www.dyve.net/jquery/?autocomplete > > Also, look at the plugins page (http://docs.jquery.com/Plugins) and > you'll find some more options for this. > > Rey > > Priest, James (NIH/NIEHS) [C] wrote: > >> I'm working on an administration tool and I'd like to use jQuery to >> populate a user field - IE the user would type in a few letters of the >> last name and have it find the matching names... >> >> I know there are lots of ColdFusion folks on the list - I'm looking for >> some examples :) >> >> I've used jQuery quite a bit in the rest of this application but it's >> all been for display/UI - no Ajax - so now I want to give that a try. >> >> Thanks! >> Jim >> >> ___ >> jQuery mailing list >> discuss@jquery.com >> http://jquery.com/discuss/ >> >> > > ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
Code is always appreciated!!! This is just using straight ColdFusion - no AjaxCFC or anything? And yes - at somepoint I'll RTFM :) Thanks! Jim > -Original Message- > From: Rey Bango [mailto:[EMAIL PROTECTED] > Sent: Monday, February 26, 2007 9:57 AM > To: jQuery Discussion. > Subject: Re: [jQuery] jQuery + ColdFusion - auto complete examples? > > And in case you wanted some code, here's the way that I used it: > ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
Hi, Rey... I've been watching this conversation carefully because I want to begin using autocomplete in my apps. Questions about your solution below: If I'm understanding the code correctly, this is a lookup by sku or product title, right? And products with matching sku's would return the product name and the sku to formfield where the autocomplete was being used? Was the formfield being typed in a text input field? Also, I'm still on CF 4.5 and I know I've got the cfheader and cfcontent tags available to me, but I don't have cfsavecontent... is there a work-around for the lack of that tag? Can I code it without cfsavecontent? And what roll does cfsavecontent play in the solution with jQuery? Last question... (sorry so many!)... is the code, "#trim( prods )#" what is being output back to the calling page for display? Would it be possible for you to put a simple demo online using your code so I can see how it's operating? Thanks for all your help in understanding this! It's definitely new ground working with jQuery and AJAX. btw... I did get an email from Tim Buntel over at Adobe. I responded to his email and I'm waiting to hear back from him. Thanks! :o) Rick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rey Bango Sent: Monday, February 26, 2007 9:57 AM To: jQuery Discussion. Subject: Re: [jQuery] jQuery + ColdFusion - auto complete examples? And in case you wanted some code, here's the way that I used it: Main page that uses autocomplete: $(document).ready(function() { $("#sku").autocomplete("searchskus.cfm", { minChars:3, matchSubset:1, matchContains:1, cacheLength:10, selectOnly:1, lineSeparator:"~", cellSeparator:"|", onItemSelect:selectItem }); }); function selectItem(li) { var v = li.extra[0]; $( "#sku" ).val( v ); } CFM Called by AutoComplete Ajax method: select title, sku from products where (title like '%#url.q#%' or sku like '%#url.q#%') and parentSKU = '' order by title #trim(product.title)#|#trim(product.sku)#~ #trim( prods )# Priest, James (NIH/NIEHS) [C] wrote: > I'm working on an administration tool and I'd like to use jQuery to > populate a user field - IE the user would type in a few letters of the > last name and have it find the matching names... > > I know there are lots of ColdFusion folks on the list - I'm looking for > some examples :) > > I've used jQuery quite a bit in the rest of this application but it's > all been for display/UI - no Ajax - so now I want to give that a try. > > Thanks! > Jim > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
And in case you wanted some code, here's the way that I used it: Main page that uses autocomplete: $(document).ready(function() { $("#sku").autocomplete("searchskus.cfm", { minChars:3, matchSubset:1, matchContains:1, cacheLength:10, selectOnly:1, lineSeparator:"~", cellSeparator:"|", onItemSelect:selectItem }); }); function selectItem(li) { var v = li.extra[0]; $( "#sku" ).val( v ); } CFM Called by AutoComplete Ajax method: select title, sku from products where (title like '%#url.q#%' or sku like '%#url.q#%') and parentSKU = '' order by title #trim(product.title)#|#trim(product.sku)#~ #trim( prods )# Priest, James (NIH/NIEHS) [C] wrote: > I'm working on an administration tool and I'd like to use jQuery to > populate a user field - IE the user would type in a few letters of the > last name and have it find the matching names... > > I know there are lots of ColdFusion folks on the list - I'm looking for > some examples :) > > I've used jQuery quite a bit in the rest of this application but it's > all been for display/UI - no Ajax - so now I want to give that a try. > > Thanks! > Jim > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
James!!! Welcome bud. I see you posting on my blog all of the time. Glad to see you came on over to jQuery. For autocomplete functionality, I've sued this one successfully: http://www.dyve.net/jquery/?autocomplete Also, look at the plugins page (http://docs.jquery.com/Plugins) and you'll find some more options for this. Rey Priest, James (NIH/NIEHS) [C] wrote: > I'm working on an administration tool and I'd like to use jQuery to > populate a user field - IE the user would type in a few letters of the > last name and have it find the matching names... > > I know there are lots of ColdFusion folks on the list - I'm looking for > some examples :) > > I've used jQuery quite a bit in the rest of this application but it's > all been for display/UI - no Ajax - so now I want to give that a try. > > Thanks! > Jim > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
No sweat bud. Let me know if you need anymore help. :o) Rey Priest, James (NIH/NIEHS) [C] wrote: > Paul & Rey, Thanks for the links > > Looks like a good starting point!! I'm sure I'll have questions :) > > I'm really enjoying jQuery - used it quite a bit in my current > application - everyone I've shown it too has been impressed! I've been > impressed with how easy it's been to implement everything! > > Hope the Ajax stuff is as easy :) > > Jim > >> -Original Message- >> From: Paul [mailto:[EMAIL PROTECTED] >> Sent: Monday, February 26, 2007 11:20 AM >> To: 'jQuery Discussion.' >> Subject: Re: [jQuery] jQuery + ColdFusion - auto complete examples? >> >> There is a complete CF-based example here: >> http://www.pengoworks.com/workshop/jquery/autocomplete.htm >> >> He includes the CFM as a txt file at the bottom of the page... >> >> I just implemented it and it's pretty simple to do following his lead. >> > > ___ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- BrightLight Development, LLC. 954-775- (o) 954-600-2726 (c) [EMAIL PROTECTED] http://www.iambright.com ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
Paul & Rey, Thanks for the links Looks like a good starting point!! I'm sure I'll have questions :) I'm really enjoying jQuery - used it quite a bit in my current application - everyone I've shown it too has been impressed! I've been impressed with how easy it's been to implement everything! Hope the Ajax stuff is as easy :) Jim > -Original Message- > From: Paul [mailto:[EMAIL PROTECTED] > Sent: Monday, February 26, 2007 11:20 AM > To: 'jQuery Discussion.' > Subject: Re: [jQuery] jQuery + ColdFusion - auto complete examples? > > There is a complete CF-based example here: > http://www.pengoworks.com/workshop/jquery/autocomplete.htm > > He includes the CFM as a txt file at the bottom of the page... > > I just implemented it and it's pretty simple to do following his lead. > ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/
Re: [jQuery] jQuery + ColdFusion - auto complete examples?
There is a complete CF-based example here: http://www.pengoworks.com/workshop/jquery/autocomplete.htm He includes the CFM as a txt file at the bottom of the page... I just implemented it and it's pretty simple to do following his lead. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Priest, James (NIH/NIEHS) [C] Sent: Monday, February 26, 2007 7:32 AM To: jQuery Discussion. Subject: [jQuery] jQuery + ColdFusion - auto complete examples? I'm working on an administration tool and I'd like to use jQuery to populate a user field - IE the user would type in a few letters of the last name and have it find the matching names... I know there are lots of ColdFusion folks on the list - I'm looking for some examples :) I've used jQuery quite a bit in the rest of this application but it's all been for display/UI - no Ajax - so now I want to give that a try. Thanks! Jim ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/ ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/