Re: [WebDNA] WebDNA autosuggest
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 105712
interpreted = N
texte = HiYes, be great if you could share. I'd tried a jQuery before but it used JSONso had to rule it out.Thanks,on 18/8/10 7:45 AM, Olin Lagon at olin.lagon@gmail.com wrote:> Here is an example of a WebDNA autosuggest that works in IE> > http://www.kanuhawaii.org/signup/> > It is working on the zipcode.> > I used a jquery plugin. Happy to share if anyone is interested.> > -----Original Message-----> From: christophe.billiottet@webdna.us> [mailto:christophe.billiottet@webdna.us]> Sent: Tuesday, August 17, 2010 12:14 AM> To: talk@webdna.us> Subject: Re: [WebDNA] WebDNA autosuggest> > Ooops, sorry, it was from Jim Lanford... here his original email:> > > I've been using Ajax since Sept 05. Works with Explorer, Firefox, Safari> etc.> > I posted this 2005/08/04 16:20:51 - still in the archives,> > .....> How do you have JavaScript put stuff into WebDNA?> > Its easy.> This sample shows how to do a similar Google autosuggest.> 1) get this sample code listed in this article> http://www.webreference.com/programming/javascript/ncz/column3/3.html> 2) replace the suggestions.php with suggestions.tpl> > suggestions.tpl> [search db=db/suggestions.db&bwSTATEdatarq=[userInput]&STATEsort=1]> [[founditems]"[state]" ,[/founditems][/search]]> > create suggestions.db (field name of state) with a list of states or> whatever suggestion terms you want.> > This shows reading from db, to write do the same thing but have your> template append or replace or...> > Enjoy> > - Jim> > ps> > Original AJAX article:> http://www.adaptivepath.com/publications/essays/archives/000385.php> > pps> Google maps is left as an exercise to the reader :-)> > > > > On Aug 16, 2010, at 23:24, Stuart Tremain wrote:> >> Sorry>> >> It wasn't written by me, I think that Chris has inadvertently credited it> to me.>> >> Regards>> >> Stuart Tremain>> IDFK Web Developments>> AUSTRALIA>> webdna@idfk.com.au>> >> >> >> >> On 17/08/2010, at 12:17 PM, Diane Blackmore (Cohesion) wrote:>> >>> Hi>>> >>> I've had this in use with a few development sites, and have only just>>> realised that it doesn't work in IE... Eeeeek. Kinda important stuff.>>> >>> Since it's a great autosuggest, could Stuart or someone get this working>>> please - Javascript isn't my strength but the syntax is apparently out at>>> char 13 on line 42 of 'remotesuggestion.js'.>>> >>> >>> Thanks,>>> >>> >>> on 18/3/10 11:13 PM, christophe.billiottet@webdna.us at>>> christophe.billiottet@webdna.us wrote:>>> >>>> There is an autosuggest in the site resources download. It as been> written by>>>> Stuart and works quite well: http://www.webdna.us/page.dna?numero=5>>>> >>>> - chris>>>> >>>> >>>> On Mar 18, 2010, at 0:01, Diane Blackmore (Cohesion) wrote:>>>> >>>>> Hi>>>>> >>>>> My experience with ajax is limited but I have done some. I needed an> ajax>>>>> tool to allow an 'atuosuggest' function (like Google has to make> suggestions>>>>> after a few letters/words have been typed). Found one (and a good one)> but I>>>>> cannot get it to work when using a URL to gather the data object rather> than>>>>> just using a string in the js itself.>>>>> >>>>> Jquery tool is AutoSuggest: Docs found at>>>>> http://code.drewwilson.com/entry/autosuggest-jquery-plugin>>>>> I'm using it under jQuery 1.3.2.>>>>> >>>>> Here is the code that works;>>>>> >>>>>> >>>>> >>>>> Or in raw format;>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Looks fine, except that when db is actually complete there'll be 2500> schools>>>>> so we don't want that listed on the page. Therefore we need to call the>>>>> search on another page... Which is what I usually do, however in this>>>>> instance I don't seem to be getting the opportunity to 'clean' the> result of>>>>> stuff that I don't want - like the opening "" which> the js>>>>> above won't want to see at all, and maybe some line-feeds or other> characters>>>>> also. >>>>> >>>>> Usually clean data with replace(/\s*/, "")>>>>> >>>>> Code to use a URL rather than a data string as above is;>>>>>> >>>>>> >>>>> >>>>> >>>>> ... Where '_findSchools.csn' is the page doing the WebDNA processing as>>>>> follows;>>>>> >>>>> >>>>>> >>>>>> [search >>>>>> > db=../db/schools.db&geschooliddatarq=1&eqsch_livedatarq=T&asschool_namesort=>>>>>> 1][founditems]{value: "[schoolid]", name: "[school_name]"}[hideif>>>>>> [index]=[numfound]],[/hideif][/founditems][/search]>>>>> >>>>> However this doesn't come back with a valid format even when the> results are>>>>> pasted straight in to the "_findSchools.csn" page. Tried adding>>>>> [SETMIMEHEADER name=Content-type&value=application/json] since the PHP>>>>> example had a similar thing but no luck there either.>>>>> >>>>> PHP 'example' provided by plugin app developer reads;>>>>> >>>>>> >>>>>> $input = $_GET["q"];>>>>>> $data = array();>>>>>> // query your DataBase here looking for a match to $input>>>>>> $query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE>>>>>> '%$input%'");>>>>>> while ($row = mysql_fetch_assoc($query)) {>>>>>> $json = array();>>>>>> $json['value'] = $row['id'];>>>>>> $json['name'] = $row['username'];>>>>>> $json['image'] = $row['user_photo'];>>>>>> $data[] = $json;>>>>>> }>>>>>> header("Content-type: application/json");>>>>>> echo json_encode($data);>>>>>> ?>>>>>> >>>>> >>>>> >>>>> Basically, can anyone tell me how I can get the data back in the JSON> format>>>>> it needs, without the extra WebDNA stuff that it doesn't need.>>>>> >>>>> >>>>> Thanks heaps if you can help,>>>>> >>>>> >>>>> >>>>>
>>>> >>>> --------------------------------------------------------->>>> This message is sent to you because you are subscribed to>>>> the mailing list .>>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>> old archives: http://dev.webdna.us/TalkListArchive/>>>> Bug Reporting:> http://forum.webdna.us/eucabb.html?page=topics&category=288>>>> >>>> >>> >>> >>> >>> >>> >>> --------------------------------------------------------->>> This message is sent to you because you are subscribed to>>> the mailing list .>>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us>>> Bug Reporting: support@webdna.us>> >> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> >
Associated Messages, from the most recent to the oldest:
HiYes, be great if you could share. I'd tried a jQuery before but it used JSONso had to rule it out.Thanks,on 18/8/10 7:45 AM, Olin Lagon at olin.lagon@gmail.com wrote:> Here is an example of a WebDNA autosuggest that works in IE> > http://www.kanuhawaii.org/signup/> > It is working on the zipcode.> > I used a jquery plugin. Happy to share if anyone is interested.> > -----Original Message-----> From: christophe.billiottet@webdna.us> [mailto:christophe.billiottet@webdna.us]> Sent: Tuesday, August 17, 2010 12:14 AM> To: talk@webdna.us> Subject: Re: [WebDNA] WebDNA autosuggest> > Ooops, sorry, it was from Jim Lanford... here his original email:> > > I've been using Ajax since Sept 05. Works with Explorer, Firefox, Safari> etc.> > I posted this 2005/08/04 16:20:51 - still in the archives,> > .....> How do you have JavaScript put stuff into WebDNA?> > Its easy.> This sample shows how to do a similar Google autosuggest.> 1) get this sample code listed in this article> http://www.webreference.com/programming/javascript/ncz/column3/3.html> 2) replace the suggestions.php with suggestions.tpl> > suggestions.tpl> [search db=db/suggestions.db&bwSTATEdatarq=[userInput]&STATEsort=1]> [[founditems]"[state]" ,[/founditems][/search]]> > create suggestions.db (field name of state) with a list of states or> whatever suggestion terms you want.> > This shows reading from db, to write do the same thing but have your> template append or replace or...> > Enjoy> > - Jim> > ps> > Original AJAX article:> http://www.adaptivepath.com/publications/essays/archives/000385.php> > pps> Google maps is left as an exercise to the reader :-)> > > > > On Aug 16, 2010, at 23:24, Stuart Tremain wrote:> >> Sorry>> >> It wasn't written by me, I think that Chris has inadvertently credited it> to me.>> >> Regards>> >> Stuart Tremain>> IDFK Web Developments>> AUSTRALIA>> webdna@idfk.com.au>> >> >> >> >> On 17/08/2010, at 12:17 PM, Diane Blackmore (Cohesion) wrote:>> >>> Hi>>> >>> I've had this in use with a few development sites, and have only just>>> realised that it doesn't work in IE... Eeeeek. Kinda important stuff.>>> >>> Since it's a great autosuggest, could Stuart or someone get this working>>> please - Javascript isn't my strength but the syntax is apparently out at>>> char 13 on line 42 of 'remotesuggestion.js'.>>> >>> >>> Thanks,>>> >>> >>> on 18/3/10 11:13 PM, christophe.billiottet@webdna.us at>>> christophe.billiottet@webdna.us wrote:>>> >>>> There is an autosuggest in the site resources download. It as been> written by>>>> Stuart and works quite well: http://www.webdna.us/page.dna?numero=5>>>> >>>> - chris>>>> >>>> >>>> On Mar 18, 2010, at 0:01, Diane Blackmore (Cohesion) wrote:>>>> >>>>> Hi>>>>> >>>>> My experience with ajax is limited but I have done some. I needed an> ajax>>>>> tool to allow an 'atuosuggest' function (like Google has to make> suggestions>>>>> after a few letters/words have been typed). Found one (and a good one)> but I>>>>> cannot get it to work when using a URL to gather the data object rather> than>>>>> just using a string in the js itself.>>>>> >>>>> Jquery tool is AutoSuggest: Docs found at>>>>> http://code.drewwilson.com/entry/autosuggest-jquery-plugin>>>>> I'm using it under jQuery 1.3.2.>>>>> >>>>> Here is the code that works;>>>>> >>>>>> >>>>> >>>>> Or in raw format;>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> Looks fine, except that when db is actually complete there'll be 2500> schools>>>>> so we don't want that listed on the page. Therefore we need to call the>>>>> search on another page... Which is what I usually do, however in this>>>>> instance I don't seem to be getting the opportunity to 'clean' the> result of>>>>> stuff that I don't want - like the opening "" which> the js>>>>> above won't want to see at all, and maybe some line-feeds or other> characters>>>>> also. >>>>> >>>>> Usually clean data with replace(/\s*/, "")>>>>> >>>>> Code to use a URL rather than a data string as above is;>>>>>> >>>>>> >>>>> >>>>> >>>>> ... Where '_findSchools.csn' is the page doing the WebDNA processing as>>>>> follows;>>>>> >>>>> >>>>>> >>>>>> [search >>>>>> > db=../db/schools.db&geschooliddatarq=1&eqsch_livedatarq=T&asschool_namesort=>>>>>> 1][founditems]{value: "[schoolid]", name: "[school_name]"}[hideif>>>>>> [index]=[numfound]],[/hideif][/founditems][/search]>>>>> >>>>> However this doesn't come back with a valid format even when the> results are>>>>> pasted straight in to the "_findSchools.csn" page. Tried adding>>>>> [SETMIMEHEADER name=Content-type&value=application/json] since the PHP>>>>> example had a similar thing but no luck there either.>>>>> >>>>> PHP 'example' provided by plugin app developer reads;>>>>> >>>>>> >>>>>> $input = $_GET["q"];>>>>>> $data = array();>>>>>> // query your DataBase here looking for a match to $input>>>>>> $query = mysql_query("SELECT * FROM my_table WHERE my_field LIKE>>>>>> '%$input%'");>>>>>> while ($row = mysql_fetch_assoc($query)) {>>>>>> $json = array();>>>>>> $json['value'] = $row['id'];>>>>>> $json['name'] = $row['username'];>>>>>> $json['image'] = $row['user_photo'];>>>>>> $data[] = $json;>>>>>> }>>>>>> header("Content-type: application/json");>>>>>> echo json_encode($data);>>>>>> ?>>>>>> >>>>> >>>>> >>>>> Basically, can anyone tell me how I can get the data back in the JSON> format>>>>> it needs, without the extra WebDNA stuff that it doesn't need.>>>>> >>>>> >>>>> Thanks heaps if you can help,>>>>> >>>>> >>>>> >>>>> >>>> >>>> --------------------------------------------------------->>>> This message is sent to you because you are subscribed to>>>> the mailing list .>>>> To unsubscribe, E-mail to: >>>> archives: http://mail.webdna.us/list/talk@webdna.us>>>> old archives: http://dev.webdna.us/TalkListArchive/>>>> Bug Reporting:> http://forum.webdna.us/eucabb.html?page=topics&category=288>>>> >>>> >>> >>> >>> >>> >>> >>> --------------------------------------------------------->>> This message is sent to you because you are subscribed to>>> the mailing list .>>> To unsubscribe, E-mail to: >>> archives: http://mail.webdna.us/list/talk@webdna.us>>> Bug Reporting: support@webdna.us>> >> --------------------------------------------------------->> This message is sent to you because you are subscribed to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> > ---------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us> >
"Diane Blackmore (Cohesion)"
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WebMerchant 1.6 and SHTML (1997)
WebCatalog [FoundItems] Problem - LONG - (1997)
TeaRoom (1997)
OT JavaScript question (1999)
Adding up weights (1998)
.. more on sliding discounts... (1997)
WebCatalog seems to choke on large (2meg) html files. (1998)
PhotoMill -> PhotoMaster (1997)
WebCatalog stalls (1998)
Wanted: More Math Functions (or, Can You Solve This?) (1997)
Macos8.6 to X migration problems (2000)
purchase.log file (1997)
DataBaseHelper Flawed (1997)
Re:2nd WebCatalog2 Feature Request (1996)
question: Eudora 3.1.1 (1997)
WebDNA 4.5 (2004)
For those of you not on the WebCatalog Beta... (1997)
WebCat 5 Intranet Question (2003)
Emailer port change (1997)
Personal Web Server combined with Webcatalog 2.1 (1998)