CF - jQuery - Javascript
Hi folks - I have a question that could probably fall into multiple categories on HOF, but I thought I would start with my default list! ;-) Anyway, here's my story: I have a web page split in half. Left half has different records being displayed. Right half has a form, which populates a set of tables, and then that information appears on the left half. This process is working. The current challenge is this: The Left side has different records appearing on it as mentioned, it's not an iFrame BTW - the records have an ID number. The user would click on the ID number, and then form on the Right gets populated with that record's details. What I am hoping to do is pass the ID number using jQuery to a CF form, that gets the data from a query, passes the data back, and then that data is told to go into the proper fields to be displayed. Here are my questions/statements: I can send information to the CFM page with the ID on it. 1) When I perform the CFSTOREDPROC and assign it to a resulting variable. What do I have to do to, or what commands are needed so that it can be taken back to the original calling page. 2) Once the data comes back, what format is the data in? If anybody wants to provide any other details that I could be overlooking, I would appreciate it. Thanks, Doug ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332660 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CF - jQuery - Javascript
Hi folks - I have a question that could probably fall into multiple categories on HOF, but I thought I would start with my default list! ;-) Anyway, here's my story: I have a web page split in half. Left half has different records being displayed. Right half has a form, which populates a set of tables, and then that information appears on the left half. This process is working. The current challenge is this: The Left side has different records appearing on it as mentioned, it's not an iFrame BTW - the records have an ID number. The user would click on the ID number, and then form on the Right gets populated with that record's details. What I am hoping to do is pass the ID number using jQuery to a CF form, that gets the data from a query, passes the data back, and then that data is told to go into the proper fields to be displayed. Here are my questions/statements: I can send information to the CFM page with the ID on it. 1) When I perform the CFSTOREDPROC and assign it to a resulting variable. What do I have to do to, or what commands are needed so that it can be taken back to the original calling page. 2) Once the data comes back, what format is the data in? If anybody wants to provide any other details that I could be overlooking, I would appreciate it. Thanks, Doug ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332661 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF - jQuery - Javascript
You could use cfajaxproxy to get your recordset in json and then use jquery to populate the form fields with the values of each member of the json query object. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332662 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: CF - jQuery - Javascript
Hi, Doug... I don't know about the CFStoredProc part, but I would do it something like this: - run a query to return a list of the record numbers you want to click and display the record numbers (or person's name with ID attached) - display the record numbers with an id for each so jQuery can use the id to determine which record number is clicked - once a record number is clicked, use a jQuery ajax call to a component method which runs a query and retrieves the record information - at this point, you have a couple of options to get the information from the record to the calling page for display: 1. You can use cfSaveContent in the component method and write the CFML and HTML needed to create the page content, save the content to a variable, return the variable value in a struct to the calling and then use jQuery to append the variable values onto the calling page 2. Or you can just take the query values and assign them to a struct and return the struct value to the jQuery function and use Javascript code (such as out.push syntax) to insert the new CFML/HTML into the calling page I prefer, usually, to put the CFML and HTML into the variable as in possibility 1 above using cfSaveContent. That allows me to use CF's syntax to create the page content, which is an easier method for me, but I can use CF to jQuery to modify the page content. You don't need to use a CFForm or any form to make this work. Once you have the record numbers on your page with a link on each with an ID that jQuery can work with, you can use jQuery's AJAX functions to send and receive data back from a cfcomponent method and use jQuery to add the new record information to the right side of your page. You can specify the data format for the returned data from the component method I the URL for the component and method. For example: ../components/records.cfm?method=mGetRecordreturnFormat=json I know this seems broad, but that's just an overview. If you need help coding a solution, I'll be glad to help you work something out. I use CF and jQuery practically every day, especially using jQuery's AJAX functionality. Here's a sample of how this might look on the page: Ben Forta Name:Ben Forta Ray CamdenHobbies: Checkers, Backgammon Doug Ford Profession: CF Programmer, Adobe CF Evangelist When you click on a name on the left, the info on the right fades out, is retrieved and the new information is displayed via AJAX on the right. (links on all the names above, such as: a id=recordNumber-1 href=Ben Forta/a a id=recordNumber-2 href=Ray Camden/a a id=recordNumber-3 href=Doug Ford/a You could use jQuery to change the record name, such as Doug Ford to the color red when it is the record displayed. Quite a few options. Let me know what questions you have... It's late (1:17am!) and I'm tired from softball this evening, so I hope this makes sense. hth, Rick -Original Message- From: Doug Ford [mailto:doug.e.f...@gmail.com] Sent: Tuesday, April 06, 2010 5:31 PM To: cf-talk Subject: CF - jQuery - Javascript Hi folks - I have a question that could probably fall into multiple categories on HOF, but I thought I would start with my default list! ;-) Anyway, here's my story: I have a web page split in half. Left half has different records being displayed. Right half has a form, which populates a set of tables, and then that information appears on the left half. This process is working. The current challenge is this: The Left side has different records appearing on it as mentioned, it's not an iFrame BTW - the records have an ID number. The user would click on the ID number, and then form on the Right gets populated with that record's details. What I am hoping to do is pass the ID number using jQuery to a CF form, that gets the data from a query, passes the data back, and then that data is told to go into the proper fields to be displayed. Here are my questions/statements: I can send information to the CFM page with the ID on it. 1) When I perform the CFSTOREDPROC and assign it to a resulting variable. What do I have to do to, or what commands are needed so that it can be taken back to the original calling page. 2) Once the data comes back, what format is the data in? If anybody wants to provide any other details that I could be overlooking, I would appreciate it. Thanks, Doug ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332685 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CF - jQuery - Javascript
Use jQuery's getJSON() to call a CFC containing and returning your stored proc call. Make the returnType JSON and you'll get a JavaScript object. You can then assign various bits of the javasript object to your form, in the getJSON() callback. mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ On 7 April 2010 05:10, Doug Ford doug.e.f...@gmail.com wrote: Hi folks - I have a question that could probably fall into multiple categories on HOF, but I thought I would start with my default list! ;-) Anyway, here's my story: I have a web page split in half. Left half has different records being displayed. Right half has a form, which populates a set of tables, and then that information appears on the left half. This process is working. The current challenge is this: The Left side has different records appearing on it as mentioned, it's not an iFrame BTW - the records have an ID number. The user would click on the ID number, and then form on the Right gets populated with that record's details. What I am hoping to do is pass the ID number using jQuery to a CF form, that gets the data from a query, passes the data back, and then that data is told to go into the proper fields to be displayed. Here are my questions/statements: I can send information to the CFM page with the ID on it. 1) When I perform the CFSTOREDPROC and assign it to a resulting variable. What do I have to do to, or what commands are needed so that it can be taken back to the original calling page. 2) Once the data comes back, what format is the data in? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332686 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CF with Javascript
I'm working on a church site and there's some concern about the size of the screen versus the size of the monitor it's on. This includes random loading of photos and text. I've also had this concern on my wife's site. I'm currently calling a javascript function in body onload which reads the screensize and sets a cookie for width and a cookie for height. CF then reads those cookies and adjusts table widths, cell widths and heights, picks which images to load (same image, two sizes), etc. Seems to be working except once in awhile the program doesn't seem to pick up a change in screen size until you do a reload. When I look at Google topics on body onload they say to me that there's no guarantee body onload will fire the javascript (and, in my case, set the cookies) before other parts of the page load and - in my case - some of the CF code starts running. Comments on that? Any ideas on how to better do this? FWIW, some pages have content that I force to a small screen size. Some pages have a lot of info and, for people with bigger monitors, it will be a benefit to take advantage of that increased real estate. Larry Stephens [EMAIL PROTECTED] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309099 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF with Javascript
Couldn't you make a Preload file that runs the JS code setting everything else up before you run the body of the code? On Tue, Jul 15, 2008 at 11:40 AM, Stephens, Larry V [EMAIL PROTECTED] wrote: I'm working on a church site and there's some concern about the size of the screen versus the size of the monitor it's on. This includes random loading of photos and text. I've also had this concern on my wife's site. I'm currently calling a javascript function in body onload which reads the screensize and sets a cookie for width and a cookie for height. CF then reads those cookies and adjusts table widths, cell widths and heights, picks which images to load (same image, two sizes), etc. Seems to be working except once in awhile the program doesn't seem to pick up a change in screen size until you do a reload. When I look at Google topics on body onload they say to me that there's no guarantee body onload will fire the javascript (and, in my case, set the cookies) before other parts of the page load and - in my case - some of the CF code starts running. Comments on that? Any ideas on how to better do this? FWIW, some pages have content that I force to a small screen size. Some pages have a lot of info and, for people with bigger monitors, it will be a benefit to take advantage of that increased real estate. Larry Stephens [EMAIL PROTECTED] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309101 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF with Javascript
Stephens, Larry V wrote: Seems to be working except once in awhile the program doesn't seem to pick up a change in screen size until you do a reload. When I look at Google topics on body onload they say to me that there's no guarantee body onload will fire the javascript (and, in my case, set the cookies) before other parts of the page load and - in my case - some of the CF code starts running cf code is processed on the SERVER, BEFORE your page is presented to the user on screen, BEFORE your js code executes, BEFORE your cookie is set/changed. your onload event is too late to have its results picked up by cf from the cookie at this pageload - only on the next one. aside from that, i do not think the whole idea of serving a different content based on screen resolution is a sound one... it's like serving different content based on browser type and version... there are other, better, techniques for this. css, fluid layouts, ui enhancements, etc etc. i bet you your code (cfml and html) is anything but easily maintainable with all this trying to accommodate various screen resolutions. and how about the user's text size / zoom settings? i may be viewing your site on a 1024x768 screen/browser viewport size with my text set to display at super-mega-large size - try and cram all your extra content onto my 'increased real estate'! i will probably be seeing less than a user with a 640x480 screen... (i do not really do that, but my dad who is close to blind does use a HUGE zoom and a magnifier) didn;t mean for it to sound like a rant... sorry if it does... Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309102 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF with Javascript
cf code is processed on the SERVER, BEFORE your page is presented to the user on screen, BEFORE your js code executes, BEFORE your cookie is set/changed. your onload event is too late to have its results picked up by cf from the cookie at this pageload - only on the next one. *Good point. aside from that, i do not think the whole idea of serving a different content based on screen resolution is a sound one... it's like serving different content based on browser type and version... there are other, better, techniques for this. css, fluid layouts, ui enhancements, etc etc. i bet you your code (cfml and html) is anything but easily maintainable with all this trying to accommodate various screen resolutions. *Other than code to choose images it isn't different content but it could be varied CSS. Actually, the way I've coded it, it is fairly simple to maintain... and how about the user's text size / zoom settings? i may be viewing your site on a 1024x768 screen/browser viewport size with my text set to display at super-mega-large size - try and cram all your extra content onto my 'increased real estate'! i will probably be seeing less than a user with a 640x480 screen... (i do not really do that, but my dad who is close to blind does use a HUGE zoom and a magnifier) *I thought of that and decided there are only so many things I can seek to control and have set the limit (so far) to screen size. I'll have to see if the church brings up anything else (and maybe tell them no). didn;t mean for it to sound like a rant... sorry if it does... *Not al all... ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309109 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF with Javascript
That's a thought. I'll also need to test to make sure they didn't bookmark one of the pages and bypass the pre-load but that's doable. Thanks. -Original Message- From: Phillip Vector [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 15, 2008 2:53 PM To: CF-Talk Subject: Re: CF with Javascript Couldn't you make a Preload file that runs the JS code setting everything else up before you run the body of the code? On Tue, Jul 15, 2008 at 11:40 AM, Stephens, Larry V [EMAIL PROTECTED] wrote: I'm working on a church site and there's some concern about the size of the screen versus the size of the monitor it's on. This includes random loading of photos and text. I've also had this concern on my wife's site. I'm currently calling a javascript function in body onload which reads the screensize and sets a cookie for width and a cookie for height. CF then reads those cookies and adjusts table widths, cell widths and heights, picks which images to load (same image, two sizes), etc. Seems to be working except once in awhile the program doesn't seem to pick up a change in screen size until you do a reload. When I look at Google topics on body onload they say to me that there's no guarantee body onload will fire the javascript (and, in my case, set the cookies) before other parts of the page load and - in my case - some of the CF code starts running. Comments on that? Any ideas on how to better do this? FWIW, some pages have content that I force to a small screen size. Some pages have a lot of info and, for people with bigger monitors, it will be a benefit to take advantage of that increased real estate. Larry Stephens [EMAIL PROTECTED] ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;203748912;27390454;j Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:309110 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
CF or Javascript Suggestion
Hello all, I have a small project to do and I wanted to bounce an idea off of the community. The idea is this: I'm going to write some code that will allow a user to populate a dynamic menu drop down. Now, the code for the menu is already written. What I am doing is creating the tool for the user to: 1) Add an item to the menu Ex: Meaning if the main heading was say News, they could add under News item1, item2 etc 2) The user can edit the spelling and link of the item 3) The user can also change the order of the items. Ex: If this user wants item3 to go in the item1 slot they would change the order by clicking a button that would move the item in the list. What would be ideal, would be maybe a JavaScript menu where the user could control the order of the items and when they wanted to edit the items they would just click an edit button and edit the information they needed. When they are done, the menu order is saved to the database. If anyone has an example, suggestion or can point me in the right direction that would be great! Thanks all! ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289627 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF or Javascript Suggestion
Hi, Mallory... Sounds like a perfect job for jQuery or one of its plug-ins. jQuery is a javascript library that focuses on performance using DOM manipulation. It's quite intuitive. http://www.jquery.com Rick -Original Message- From: Mallory Woods [mailto:[EMAIL PROTECTED] Sent: Thursday, September 27, 2007 10:13 AM To: CF-Talk Subject: CF or Javascript Suggestion Hello all, I have a small project to do and I wanted to bounce an idea off of the community. The idea is this: I'm going to write some code that will allow a user to populate a dynamic menu drop down. Now, the code for the menu is already written. What I am doing is creating the tool for the user to: 1) Add an item to the menu Ex: Meaning if the main heading was say News, they could add under News item1, item2 etc 2) The user can edit the spelling and link of the item 3) The user can also change the order of the items. Ex: If this user wants item3 to go in the item1 slot they would change the order by clicking a button that would move the item in the list. What would be ideal, would be maybe a JavaScript menu where the user could control the order of the items and when they wanted to edit the items they would just click an edit button and edit the information they needed. When they are done, the menu order is saved to the database. If anyone has an example, suggestion or can point me in the right direction that would be great! Thanks all! ~| Get the answers you are looking for on the ColdFusion Labs Forum direct from active programmers and developers. http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72catid=648 Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289682 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Good cf-compatible javascript library to handle dragable page sections
Is there a cf-compatible javascript library that can handle the drag-and-drop window areas like those found on google.com or pageflakes.com? Pageflakes does it with the .net Atlas widgets. http://www.google.com/ig?hl=enned=ustab=nwq= http://www.pageflakes.com/ I'd love to play with something like this, but am reluctant to sink the hours at the moment into building it myself. thanks for any info, Jerry Johnson ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274883 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Good cf-compatible javascript library to handle dragable page sections
Jerry, jQuery's interface plugin is very capable of doing that: http://docs.jquery.com/Plugins:Interface HTH, Jon On Apr 9, 2007, at 3:13 PM, Jerry Johnson wrote: Is there a cf-compatible javascript library that can handle the drag-and-drop window areas like those found on google.com or pageflakes.com? Pageflakes does it with the .net Atlas widgets. http://www.google.com/ig?hl=enned=ustab=nwq= http://www.pageflakes.com/ I'd love to play with something like this, but am reluctant to sink the hours at the moment into building it myself. thanks for any info, Jerry Johnson ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274884 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Good cf-compatible javascript library to handle dragable page sections
JS is techincally not compatible with any server side technology as it is a client side tool. There are several libs around, script.aculo.us, JQuery is a popular one with ColdFusion developers but in essense all libs are compatible, you just have to do the work :-) This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, Registered in England, Number 678540. It contains information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of distribution, copying or use of this communication or the information in it is strictly prohibited and may be unlawful. If you have received this communication in error please return it to the sender or call our switchboard on +44 (0) 20 89107910. The opinions expressed within this communication are not necessarily those expressed by Reed Exhibitions. Visit our website at http://www.reedexpo.com -Original Message- From: Jerry Johnson To: CF-Talk Sent: Mon Apr 09 20:13:26 2007 Subject: Good cf-compatible javascript library to handle dragable page sections Is there a cf-compatible javascript library that can handle the drag-and-drop window areas like those found on google.com or pageflakes.com? Pageflakes does it with the .net Atlas widgets. http://www.google.com/ig?hl=enned=ustab=nwq= http://www.pageflakes.com/ I'd love to play with something like this, but am reluctant to sink the hours at the moment into building it myself. thanks for any info, Jerry Johnson ~| ColdFusion MX7 by Adobe® Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7. Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274885 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Good cf-compatible javascript library to handle dragable page sections
I found this one earlier today when looking for a slushbox. http://www.indiankey.com/mxajax/index.cfm ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274887 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Good cf-compatible javascript library to handle dragable page sections
I found this one earlier while looking for a slushbox: http://www.indiankey.com/mxajax/index.cfm ~| Upgrade to Adobe ColdFusion MX7 Experience Flex 2 MX7 integration create powerful cross-platform RIAs http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274888 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Good cf-compatible javascript library to handle dragable page sections
Thanks, Jon, That is exactly what I was hoping for. I realize that a given javascript implementation is not always tied directly to the application server technology, but there are always favorites and people who've already done it I am hoping to piggyback onto. On 4/9/07, Jon Clausen [EMAIL PROTECTED] wrote: Jerry, jQuery's interface plugin is very capable of doing that: http://docs.jquery.com/Plugins:Interface ~| Create Web Applications With ColdFusion MX7 Flex 2. Build powerful, scalable RIAs. Free Trial http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274902 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Good cf-compatible javascript library to handle dragable page sections
+1 for jQuery in general. :o) Cheers, Chris Jon Clausen wrote: Jerry, jQuery's interface plugin is very capable of doing that: http://docs.jquery.com/Plugins:Interface HTH, Jon On Apr 9, 2007, at 3:13 PM, Jerry Johnson wrote: Is there a cf-compatible javascript library that can handle the drag-and-drop window areas like those found on google.com or pageflakes.com? Pageflakes does it with the .net Atlas widgets. http://www.google.com/ig?hl=enned=ustab=nwq= http://www.pageflakes.com/ I'd love to play with something like this, but am reluctant to sink the hours at the moment into building it myself. thanks for any info, Jerry Johnson ~| ColdFusion MX7 and Flex 2 Build sales marketing dashboard RIAâs for your business. Upgrade now http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:274905 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Mixing CF and JavaScript.
I am on Day 5 with CF and Coming along nicely. I have a question on mixing CF and Javascript. Say I have the following with an onBlur event: input type=textfield name=upc id=upc size=12 maxlength=12 onblur=lookUpUPC(this.value); / Here is the JS for LookUpUPC() function lookUpUPC(upc) { cfquery name=ckUPC datasource=#application.dsn# SELECT Description, UnitPrice FROM Inventoryitems WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar value=upc; /cfquery cfif ckUPC.recordCount EQ 1 alert(UPC FOUND); cfelse alert(UPC NOT FOUND); /cfif } When LookUpUPC fires I get just the alert boxes that I coded in for information purposes. I tried hard coding the query with a valid upc in the database and still I get UPC not found. So I must be doing something wrong but I am not sure what. Can anybody shed some light? -Jason ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260370 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
You need to use AJAX. Basically, inside your lookUpUPC() function you will make a call to a CFC that does the query and hands it back to the javascript function to pupulate fields. Look into CFAjax. Jason T. Slack wrote: I am on Day 5 with CF and Coming along nicely. I have a question on mixing CF and Javascript. Say I have the following with an onBlur event: input type=textfield name=upc id=upc size=12 maxlength=12 onblur=lookUpUPC(this.value); / Here is the JS for LookUpUPC() function lookUpUPC(upc) { cfquery name=ckUPC datasource=#application.dsn# SELECT Description, UnitPrice FROM Inventoryitems WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar value=upc; /cfquery cfif ckUPC.recordCount EQ 1 alert(UPC FOUND); cfelse alert(UPC NOT FOUND); /cfif } When LookUpUPC fires I get just the alert boxes that I coded in for information purposes. I tried hard coding the query with a valid upc in the database and still I get UPC not found. So I must be doing something wrong but I am not sure what. Can anybody shed some light? -Jason ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260372 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote: I am on Day 5 with CF and Coming along nicely. I have a question on mixing CF and Javascript. Say I have the following with an onBlur event: input type=textfield name=upc id=upc size=12 maxlength=12 onblur=lookUpUPC(this.value); / Here is the JS for LookUpUPC() function lookUpUPC(upc) { cfquery name=ckUPC datasource=#application.dsn# SELECT Description, UnitPrice FROM Inventoryitems WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar value=upc; /cfquery cfif ckUPC.recordCount EQ 1 alert(UPC FOUND); cfelse alert(UPC NOT FOUND); /cfif } When LookUpUPC fires I get just the alert boxes that I coded in for information purposes. I tried hard coding the query with a valid upc in the database and still I get UPC not found. So I must be doing something wrong but I am not sure what. Can anybody shed some light? In my opinion, this is one of the hardest things for new CFers to understand. The key here is that the ColdFusion code is rendered server-side and the javascript is executed client-side. For you, this means that you can't do what you're trying to do the way you're trying to do it. You're trying to execute server code in a client function. You can accomplish the mission using AJaX, but not through inline methods like these. HTH. Rob Wilkerson ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260373 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Mixing CF and JavaScript.
So I must be doing something wrong but I am not sure what. Can anybody shed some light? -Jason ColdFusion runs on the server and Javascript runs on the client and the two don't mix. Ok, they can be made to look like they mix with Ajax and other techniques, but this isn't beginner stuff. The first way you could do what you want is with the CFWDDX... tag. It can take the query and change it into a JS array; you then look up the values in the array. This gets heavy if the recordset is larger and exposes all the data to the user, so it is not often used. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260376 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Mixing CF and JavaScript.
You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260377 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Mixing CF and JavaScript.
ColdFusion is server side. Once the page loads, CF is done. JS is client side. You can't reference CF code inside of JS after the page loads (not without getting AJAX-y). you can create JS variables with CF: script type=text/javascript var myFoo = cfoutput#myQuery.foo#/cfoutput'; /script if you view the source of that page after it loads, you'll see the JS is valid. it's identical to using CF to create HTML. However, once the page loads, you can no longer rely on CF to create any client side code. To do what you want, you'd use CF to create a JS array and your onclick would use that array. On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote: I am on Day 5 with CF and Coming along nicely. I have a question on mixing CF and Javascript. Say I have the following with an onBlur event: input type=textfield name=upc id=upc size=12 maxlength=12 onblur=lookUpUPC(this.value); / Here is the JS for LookUpUPC() function lookUpUPC(upc) { cfquery name=ckUPC datasource=#application.dsn# SELECT Description, UnitPrice FROM Inventoryitems WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar value=upc; /cfquery cfif ckUPC.recordCount EQ 1 alert(UPC FOUND); cfelse alert(UPC NOT FOUND); /cfif } When LookUpUPC fires I get just the alert boxes that I coded in for information purposes. I tried hard coding the query with a valid upc in the database and still I get UPC not found. So I must be doing something wrong but I am not sure what. Can anybody shed some light? -Jason ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260375 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
Jason, ColdFusion cannot be directly invoked from JavaScript without a interface to call a service. ColdFusion is processed and then the end result is passed through the web server to your browser. At that point essentially, the page is static. If you want interactivity, you have to call another page or service to activate CF enabled templates. This is typically done in AJAX when using JavaScript. You can do this also in Flash with Flex. Teddy On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote: I am on Day 5 with CF and Coming along nicely. I have a question on mixing CF and Javascript. Say I have the following with an onBlur event: input type=textfield name=upc id=upc size=12 maxlength=12 onblur=lookUpUPC(this.value); / Here is the JS for LookUpUPC() function lookUpUPC(upc) { cfquery name=ckUPC datasource=#application.dsn# SELECT Description, UnitPrice FROM Inventoryitems WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar value=upc; /cfquery cfif ckUPC.recordCount EQ 1 alert(UPC FOUND); cfelse alert(UPC NOT FOUND); /cfif } When LookUpUPC fires I get just the alert boxes that I coded in for information purposes. I tried hard coding the query with a valid upc in the database and still I get UPC not found. So I must be doing something wrong but I am not sure what. Can anybody shed some light? -Jason ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260378 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Mixing CF and JavaScript.
Don't you think that maybe suggesting AJAX or CFAJAX might be a little much for this user at this point? He did mention that he's on DAY 5 of CF development, you know. I like Charlie's idea. Use CF to create the structure you're looking to use, then use JS to do the lookup on that. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260380 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
yeah, that's why I threw in the mention of AJAX, but really didn't pursue that as the solution. He's probably got enough things on his plate at the moment without introducing a new technology :) On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote: Don't you think that maybe suggesting AJAX or CFAJAX might be a little much for this user at this point? He did mention that he's on DAY 5 of CF development, you know. I like Charlie's idea. Use CF to create the structure you're looking to use, then use JS to do the lookup on that. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260383 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Mixing CF and JavaScript.
Charlie and Ray, You can't do what he wants without something like Ajax. He is passing the UPC to a query and then doing something with the results in JavaScript. Yes, you can create JS vars with CF, but if you want to hit your DB like he's attempting, you'd use ajax or flash remoting. And comon', ajax is not very hard. To do what he wants with ajaxCFC would mean dropping the core files in, creating a basic CFC including his cfquery, and then cfreturn the result. I'd imagine it's similar in mxajax. -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 11:42 AM To: CF-Talk Subject: Re: Mixing CF and JavaScript. yeah, that's why I threw in the mention of AJAX, but really didn't pursue that as the solution. He's probably got enough things on his plate at the moment without introducing a new technology :) On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote: Don't you think that maybe suggesting AJAX or CFAJAX might be a little much for this user at this point? He did mention that he's on DAY 5 of CF development, you know. I like Charlie's idea. Use CF to create the structure you're looking to use, then use JS to do the lookup on that. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260385 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Mixing CF and JavaScript.
You can do exactly what he wants by loading the data into a JS array. Then his function would simply look in the array rather than trying to do a query. the cfquery in his function is querying for a specific record based on a value passed to the function. if he does a query without the WHERE and loops over that query, he can create a JS array easily. On 11/14/06, Munson, Jacob [EMAIL PROTECTED] wrote: Charlie and Ray, You can't do what he wants without something like Ajax. He is passing the UPC to a query and then doing something with the results in JavaScript. Yes, you can create JS vars with CF, but if you want to hit your DB like he's attempting, you'd use ajax or flash remoting. And comon', ajax is not very hard. To do what he wants with ajaxCFC would mean dropping the core files in, creating a basic CFC including his cfquery, and then cfreturn the result. I'd imagine it's similar in mxajax. -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 11:42 AM To: CF-Talk Subject: Re: Mixing CF and JavaScript. yeah, that's why I threw in the mention of AJAX, but really didn't pursue that as the solution. He's probably got enough things on his plate at the moment without introducing a new technology :) On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote: Don't you think that maybe suggesting AJAX or CFAJAX might be a little much for this user at this point? He did mention that he's on DAY 5 of CF development, you know. I like Charlie's idea. Use CF to create the structure you're looking to use, then use JS to do the lookup on that. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260388 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
Jake Churchill wrote: Look into CFAjax. Don't look into CFAJAX unless you like outdated code with known security vulnerabilities that isn't being updated/maintained anymore. ajaxCFC or mxajax or any variety of others, but absolutely not cfajax. Rick ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260392 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Mixing CF and JavaScript.
if he does a query without the WHERE and loops over that query, he can create a JS array easily. Even easier if he uses the cfwddx action=cfml2js ... tag, which will take a CF variable, simple or complex, and turn it into a corresponding JS variable. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260393 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Mixing CF and JavaScript.
Why can't he hit the DB with CF, return a structure, and search on that? I guess I'm missing your point as to why he can't do what he wants without having to use AJAX or Flash remoting or FLEX. Like Charlie said, learning even what a CFC is and how to use it can be a little bit daunting if you're still learning the little things that make CF, well, CF. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:58 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. Importance: High Charlie and Ray, You can't do what he wants without something like Ajax. He is passing the UPC to a query and then doing something with the results in JavaScript. Yes, you can create JS vars with CF, but if you want to hit your DB like he's attempting, you'd use ajax or flash remoting. And comon', ajax is not very hard. To do what he wants with ajaxCFC would mean dropping the core files in, creating a basic CFC including his cfquery, and then cfreturn the result. I'd imagine it's similar in mxajax. -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 11:42 AM To: CF-Talk Subject: Re: Mixing CF and JavaScript. yeah, that's why I threw in the mention of AJAX, but really didn't pursue that as the solution. He's probably got enough things on his plate at the moment without introducing a new technology :) On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote: Don't you think that maybe suggesting AJAX or CFAJAX might be a little much for this user at this point? He did mention that he's on DAY 5 of CF development, you know. I like Charlie's idea. Use CF to create the structure you're looking to use, then use JS to do the lookup on that. -Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 1:17 PM To: CF-Talk Subject: RE: Mixing CF and JavaScript. You need to use AJAX. I agree, but I wouldn't recommend CFAjax. It's outdated, and the guy that wrote it has moved on to MXAjax: http://www.indiankey.com/mxajax/ Personally I prefer ajaxCFC: http://ajaxcfc.riaforge.org/ -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260396 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
On 11/14/06, Ian Skinner [EMAIL PROTECTED] wrote: if he does a query without the WHERE and loops over that query, he can create a JS array easily. Even easier if he uses the cfwddx action=cfml2js ... tag, which will take a CF variable, simple or complex, and turn it into a corresponding JS variable. Yes, that's much better (i don't know why i don't use that). heh. BTW, just to clarify...I wasn't trying to debate over which was easier (the JS array vs AJAX), since easy is a relative term. My point was that it's possible to do without AJAX. -- Charlie Griefer ...All the world shall be your enemy, Prince with a Thousand Enemies, and whenever they catch you, they will kill you. But first they must catch you, digger, listener, runner, prince with a swift warning. Be cunning and full of tricks and your people shall never be destroyed. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260397 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Mixing CF and JavaScript.
BTW, just to clarify...I wasn't trying to debate over which was easier (the JS array vs AJAX), since easy is a relative term. My point was that it's possible to do without AJAX. And my easy was referring to the creation of the JS array, again not JS array VS AJAX. But I concur that jumping into AJAX your first week of using CF may be a bit much to ask a novice. Especially if one is coming from a procedural background rather then an Object Orientated. -- Ian Skinner Web Programmer BloodSource www.BloodSource.org Sacramento, CA - | 1 | | - Binary Soduko | | | - C code. C code run. Run code run. Please! - Cynthia Dunning Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260399 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Mixing CF and JavaScript.
You can do exactly what he wants by loading the data into a JS array. Then his function would simply look in the array rather than trying to do a query. the cfquery in his function is querying for a specific record based on a value passed to the function. if he does a query without the WHERE and loops over that query, he can create a JS array easily. Oh, I see what you mean. I stand corrected. :) That would work, as long as you're not dealing with a lot of records. Well, it would still work, but you'd potentially be sending the poor user megabytes of data in your page. ;) -- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. == EMF idahopower.com made the previous annotations. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260403 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
I reviewed every one's response so far and I did like a single one. I would use a bakery analogy. For example CF is like a cake it gets baked first then the sweet buttery javascript icing goes last. The two don't mix well. To cut the layers you need a fork called AJAX bla bla bla. What you need to do is change things around and make Javascript into a cake too and CF the cake next to your new js cake of pure icing. When people eat your cake they dream of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest bla bla bla because JS longs to be a reasonable cake. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260430 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Mixing CF and JavaScript.
I think for a guy who's on day 5...all that analogy is going to do is make him more confused and hungry for cake. On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote: I reviewed every one's response so far and I did like a single one. I would use a bakery analogy. For example CF is like a cake it gets baked first then the sweet buttery javascript icing goes last. The two don't mix well. To cut the layers you need a fork called AJAX bla bla bla. What you need to do is change things around and make Javascript into a cake too and CF the cake next to your new js cake of pure icing. When people eat your cake they dream of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest bla bla bla because JS longs to be a reasonable cake. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260431 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Mixing CF and JavaScript.
Im on year 5 and I am hungry for cake! On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote: I think for a guy who's on day 5...all that analogy is going to do is make him more confused and hungry for cake. On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote: I reviewed every one's response so far and I did like a single one. I would use a bakery analogy. For example CF is like a cake it gets baked first then the sweet buttery javascript icing goes last. The two don't mix well. To cut the layers you need a fork called AJAX bla bla bla. What you need to do is change things around and make Javascript into a cake too and CF the cake next to your new js cake of pure icing. When people eat your cake they dream of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest bla bla bla because JS longs to be a reasonable cake. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260433 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Mixing CF and JavaScript.
To cake or not to bake, that is the question... Whether 'tis nobler in the kitchen to suffer the slings and arrows of outrageous icing or to bear arms against a sea of debugging - and by opposing, to make a sandwich... - Will Bakespeare -Jon*needs to eat some dinner* On Nov 14, 2006, at 7:00 PM, Dan Vega wrote: Im on year 5 and I am hungry for cake! On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote: I think for a guy who's on day 5...all that analogy is going to do is make him more confused and hungry for cake. On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote: I reviewed every one's response so far and I did like a single one. I would use a bakery analogy. For example CF is like a cake it gets baked first then the sweet buttery javascript icing goes last. The two don't mix well. To cut the layers you need a fork called AJAX bla bla bla. What you need to do is change things around and make Javascript into a cake too and CF the cake next to your new js cake of pure icing. When people eat your cake they dream of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest bla bla bla because JS longs to be a reasonable cake. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260436 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Mixing CF and JavaScript.
Heres my .02 Do an iframe with the variable in the Url of the iframe. Do an onblur event on the field to reload the iframe. Put your Query and Display element in the iframe. I say this because if your doing a query on a DB with millions of records an aray might not be a good idea.? I use that approach for my data entry people for Addresses on the Zip Code to get County Contact info. On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote: I think for a guy who's on day 5...all that analogy is going to do is make him more confused and hungry for cake. On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote: I reviewed every one's response so far and I did like a single one. I would use a bakery analogy. For example CF is like a cake it gets baked first then the sweet buttery javascript icing goes last. The two don't mix well. To cut the layers you need a fork called AJAX bla bla bla. What you need to do is change things around and make Javascript into a cake too and CF the cake next to your new js cake of pure icing. When people eat your cake they dream of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest bla bla bla because JS longs to be a reasonable cake. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260437 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
CF and JavaScript
Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253314 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF and JavaScript
Can you use cf tags inside of JavaScript? Yes. --- This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253315 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF and JavaScript
Can you use cf tags inside of JavaScript? Yes. However, you must remember that your CF code is executed on the server, and will execute before the client even sees your Javascript code. So, they can't intermingle at runtime in any useful way - there are two runtimes, CF on the server and JS on the client. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253316 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF and JavaScript
yes you can. cfset variables.username = Charlie / script type=text/javascript cfoutputalert(#variables.username#);/cfoutput /script JS is read/interpreted by the browser, just the same as HTML. Just as you can use CF to output/generate HTML, you can use it to output/generate JS. On 9/15/06, David S. Neuman [EMAIL PROTECTED] wrote: Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253317 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF and JavaScript
yeah, you sure can. I have a timer that I have CF stuff in and it works fine.. html head script cfoutput var dateString = (#dateFormat(now(),MM/DD/)# #timeFormat(now(),hh:mm:ss)#); var i = #timeFormat(now(),ss)#; /cfoutput function updateClock(){ var DateVariable = new Date(dateString); DateVariable.setSeconds(i); document.getElementById(clock).innerHTML = (DateVariable); i += 1; timer(); } function firstLoad(){ timer(); updateClock(); } function timer(){ setTimeout('updateClock()',1000); } /script titleRight Frame/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body leftmargin=5 onLoad=return updateClock() form name=mainForm table width=100% cellspacing=0 cellpadding=0 border=0 tr td bgcolor=7cb5d6 height=24 valign=topMuzicSource Management Console V 1.0/td td align=right bgcolor=7cb5d6 valign=topspan name=SHOW_PRICE_TOP id=clock/span/td /tr /table /form /body /html - Original Message - From: David S. Neuman [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, September 15, 2006 2:58 PM Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253319 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF and JavaScript
What are you trying to do? ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 4:58 PM To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253325 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF and JavaScript
Here's a hangup that I am having. I'm dynamically outputting data into javascript, such as first and last names. Some of the last names in the database have apostrophe's in them, like O'neill, O'Connor, etc. How would I go about fixing the data so when the data is dynamically output, I don't run into javascript errors, because some of the data has the apostrophes? Here is the code: HINTS_ITEMS = { cfloop query=fsisinfo #id#:wrap(#firstname# #MI# #lastname# #suffix#, true), #id#0:'table cellpadding=5 cellpadding=5 style=border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black;trtd nowrap=nowrap align=left#firstname# #mi# #lastname#/td/trtrtd nowrap=nowrap align=left#title#/td/trtrtd nowrap=nowrap align=left#address1#/td/trtrtd nowrap=nowrap align=left#address2#/td/trtrtd nowrap=nowrap align=left#city#, #state#/td/trtrtd nowrap=nowrap align=left#zip#/td/trtrtd nowrap=nowrap align=leftPhone: #Left(phone, 3)# - #Mid(phone, 4,3)# - #Right(phone, 4)#/td/trtrtd nowrap=nowrap align=leftFax: #Left(fax, 3)# - #Mid(fax, 4,3)# - #Right(fax, 4)#/td/trtrtd nowrap=nowrap align=left#email#/td/tr/table', /cfloop }; Thanks, Dave David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 5:31 PM To: CF-Talk Subject: RE: CF and JavaScript What are you trying to do? ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 4:58 PM To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253332 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CF and JavaScript
You need to escape those characters, so in your coldfusion you will need to search for those and append an / before the quote. Then when you insert it into your javascript you will not have issues. Doug - Original Message - From: David S. Neuman [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Friday, September 15, 2006 7:08 PM Subject: RE: CF and JavaScript Here's a hangup that I am having. I'm dynamically outputting data into javascript, such as first and last names. Some of the last names in the database have apostrophe's in them, like O'neill, O'Connor, etc. How would I go about fixing the data so when the data is dynamically output, I don't run into javascript errors, because some of the data has the apostrophes? Here is the code: HINTS_ITEMS = { cfloop query=fsisinfo #id#:wrap(#firstname# #MI# #lastname# #suffix#, true), #id#0:'table cellpadding=5 cellpadding=5 style=border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black;trtd nowrap=nowrap align=left#firstname# #mi# #lastname#/td/trtrtd nowrap=nowrap align=left#title#/td/trtrtd nowrap=nowrap align=left#address1#/td/trtrtd nowrap=nowrap align=left#address2#/td/trtrtd nowrap=nowrap align=left#city#, #state#/td/trtrtd nowrap=nowrap align=left#zip#/td/trtrtd nowrap=nowrap align=leftPhone: #Left(phone, 3)# - #Mid(phone, 4,3)# - #Right(phone, 4)#/td/trtrtd nowrap=nowrap align=leftFax: #Left(fax, 3)# - #Mid(fax, 4,3)# - #Right(fax, 4)#/td/trtrtd nowrap=nowrap align=left#email#/td/tr/table', /cfloop }; Thanks, Dave David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 5:31 PM To: CF-Talk Subject: RE: CF and JavaScript What are you trying to do? ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 4:58 PM To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253334 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: CF and JavaScript
The JSStringFormat() CF function. On 9/16/06, David S. Neuman [EMAIL PROTECTED] wrote: Here's a hangup that I am having. I'm dynamically outputting data into javascript, such as first and last names. Some of the last names in the database have apostrophe's in them, like O'neill, O'Connor, etc. How would I go about fixing the data so when the data is dynamically output, I don't run into javascript errors, because some of the data has the apostrophes? Here is the code: HINTS_ITEMS = { cfloop query=fsisinfo #id#:wrap(#firstname# #MI# #lastname# #suffix#, true), #id#0:'table cellpadding=5 cellpadding=5 style=border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black;trtd nowrap=nowrap align=left#firstname# #mi# #lastname#/td/trtrtd nowrap=nowrap align=left#title#/td/trtrtd nowrap=nowrap align=left#address1#/td/trtrtd nowrap=nowrap align=left#address2#/td/trtrtd nowrap=nowrap align=left#city#, #state#/td/trtrtd nowrap=nowrap align=left#zip#/td/trtrtd nowrap=nowrap align=leftPhone: #Left(phone, 3)# - #Mid(phone, 4,3)# - #Right(phone, 4)#/td/trtrtd nowrap=nowrap align=leftFax: #Left(fax, 3)# - #Mid(fax, 4,3)# - #Right(fax, 4)#/td/trtrtd nowrap=nowrap align=left#email#/td/tr/table', /cfloop }; Thanks, Dave David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 5:31 PM To: CF-Talk Subject: RE: CF and JavaScript What are you trying to do? ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 4:58 PM To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253335 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CF and JavaScript
Yes you can, but you cannot use JavaScript to create cf tags as JavaScript is processed after cf. Eric -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, 15 September 2006 15:58 To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253337 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: CF and JavaScript
Use CF's JsStringFormat() ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 9:08 PM To: CF-Talk Subject: RE: CF and JavaScript Here's a hangup that I am having. I'm dynamically outputting data into javascript, such as first and last names. Some of the last names in the database have apostrophe's in them, like O'neill, O'Connor, etc. How would I go about fixing the data so when the data is dynamically output, I don't run into javascript errors, because some of the data has the apostrophes? Here is the code: HINTS_ITEMS = { cfloop query=fsisinfo #id#:wrap(#firstname# #MI# #lastname# #suffix#, true), #id#0:'table cellpadding=5 cellpadding=5 style=border-bottom:1px solid black; border-top:1px solid black; border-right:1px solid black; border-left:1px solid black;trtd nowrap=nowrap align=left#firstname# #mi# #lastname#/td/trtrtd nowrap=nowrap align=left#title#/td/trtrtd nowrap=nowrap align=left#address1#/td/trtrtd nowrap=nowrap align=left#address2#/td/trtrtd nowrap=nowrap align=left#city#, #state#/td/trtrtd nowrap=nowrap align=left#zip#/td/trtrtd nowrap=nowrap align=leftPhone: #Left(phone, 3)# - #Mid(phone, 4,3)# - #Right(phone, 4)#/td/trtrtd nowrap=nowrap align=leftFax: #Left(fax, 3)# - #Mid(fax, 4,3)# - #Right(fax, 4)#/td/trtrtd nowrap=nowrap align=left#email#/td/tr/table', /cfloop }; Thanks, Dave David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 5:31 PM To: CF-Talk Subject: RE: CF and JavaScript What are you trying to do? :.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: David S. Neuman [mailto:[EMAIL PROTECTED] Sent: Friday, September 15, 2006 4:58 PM To: CF-Talk Subject: CF and JavaScript Hello, I have a question. Can you use cf tags inside of JavaScript? I'm trying to do something and it's not working quite right. Thanks David S. Neuman Developer 2081 Industrial Blvd StillwaterMN55082 mail: [EMAIL PROTECTED] www: http://www.ejhassociates.com tel: 651.717.4106 fax: 651.717.4116 mob: 952.239.3990 This message contains confidential information and is intended only for [EMAIL PROTECTED] If you are not cf-talk@houseoffusion.com you should not disseminate, distribute or copy this e-mail. Please notify [EMAIL PROTECTED] immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. David S. Neuman therefore does not accept liability for any errors or omissions in the contents of this message, which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. ~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253339 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Know with cf if Javascript is enabled?
Hey guys, Does anyone know a way that I can let coldfusion know if javascript is enabled in a browser or not? I would like to set a session variable that tells me this so I can dynamically show a message if it is not enabled. I would like to be able to do this without the user having to do anything. We are automatically logging people in using ntauthentication on this site, so I would like it to check during that process and set a cf variable. I need it to work primarily in IE 6+ but it would be nice if it worked in FF as well. My google searches so far this morning haven't come up with anything that worked. There is the noscript tag, but it isn't evaluated until the browser gets the page and so there is no way for coldfusion to evaluate it. Plus it doesnt seem to work in firefox or IE either anyway. Any ideas? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225532 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Know with cf if Javascript is enabled?
You could do a JS redirect to a CF page... if the user gets there, they have JS, else they dont. You could also use js httprequest to 'hit' a page behind the scene that would set some session information to let you know rather or not they have JS on. (if the httprequest works, they have JS, else they dont) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ryan Guill [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 9:55 AM To: CF-Talk Subject: Know with cf if Javascript is enabled? Hey guys, Does anyone know a way that I can let coldfusion know if javascript is enabled in a browser or not? I would like to set a session variable that tells me this so I can dynamically show a message if it is not enabled. I would like to be able to do this without the user having to do anything. We are automatically logging people in using ntauthentication on this site, so I would like it to check during that process and set a cf variable. I need it to work primarily in IE 6+ but it would be nice if it worked in FF as well. My google searches so far this morning haven't come up with anything that worked. There is the noscript tag, but it isn't evaluated until the browser gets the page and so there is no way for coldfusion to evaluate it. Plus it doesnt seem to work in firefox or IE either anyway. Any ideas? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225535 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Know with cf if Javascript is enabled?
Thanks, ill look into that. On 11/29/05, Bobby Hartsfield [EMAIL PROTECTED] wrote: You could do a JS redirect to a CF page... if the user gets there, they have JS, else they don't. You could also use js httprequest to 'hit' a page behind the scene that would set some session information to let you know rather or not they have JS on. (if the httprequest works, they have JS, else they don't) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ryan Guill [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 9:55 AM To: CF-Talk Subject: Know with cf if Javascript is enabled? Hey guys, Does anyone know a way that I can let coldfusion know if javascript is enabled in a browser or not? I would like to set a session variable that tells me this so I can dynamically show a message if it is not enabled. I would like to be able to do this without the user having to do anything. We are automatically logging people in using ntauthentication on this site, so I would like it to check during that process and set a cf variable. I need it to work primarily in IE 6+ but it would be nice if it worked in FF as well. My google searches so far this morning haven't come up with anything that worked. There is the noscript tag, but it isn't evaluated until the browser gets the page and so there is no way for coldfusion to evaluate it. Plus it doesnt seem to work in firefox or IE either anyway. Any ideas? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225540 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Know with cf if Javascript is enabled?
You could also use JS to set a hidden field value when your first page loads. Then any subsequent pages can check that value. You might even get fancy with some cfincludes and have one set a value, and the next check it. I'm not sure if that would work or not, but it may be a way to have your first page find out if JS is enabled or not. -Original Message- From: Ryan Guill [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 8:18 AM To: CF-Talk Subject: Re: Know with cf if Javascript is enabled? Thanks, ill look into that. On 11/29/05, Bobby Hartsfield [EMAIL PROTECTED] wrote: You could do a JS redirect to a CF page... if the user gets there, they have JS, else they don't. You could also use js httprequest to 'hit' a page behind the scene that would set some session information to let you know rather or not they have JS on. (if the httprequest works, they have JS, else they don't) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ryan Guill [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 9:55 AM To: CF-Talk Subject: Know with cf if Javascript is enabled? Hey guys, Does anyone know a way that I can let coldfusion know if javascript is enabled in a browser or not? I would like to set a session variable that tells me this so I can dynamically show a message if it is not enabled. I would like to be able to do this without the user having to do anything. We are automatically logging people in using ntauthentication on this site, so I would like it to check during that process and set a cf variable. I need it to work primarily in IE 6+ but it would be nice if it worked in FF as well. My google searches so far this morning haven't come up with anything that worked. There is the noscript tag, but it isn't evaluated until the browser gets the page and so there is no way for coldfusion to evaluate it. Plus it doesnt seem to work in firefox or IE either anyway. Any ideas? -- Ryan Guill BlueEyesDevelopment [EMAIL PROTECTED] www.ryanguill.com (270) 217.2399 got google talk? Chat me at [EMAIL PROTECTED] The Coldfusion Open Application Library - COAL - http://coal.ryanguill.com www.ryanguill.com/ The Roman Empire: www.ryanguill.com/blog/ ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225562 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Know with cf if Javascript is enabled?
I've an example of a technique here: http://www.depressedpress.com/Content/Development/ColdFusion/Articles/GetRes /Index.cfm That code is really old however. The version I'm actually using is wrapped as a custom tag and determines JS version (and whether or not it's enabled) as well. I'll attach the JavaScript of it below. Jim Davis script language=Javascript type=text/javascriptvar JSVersion = 1.0/script script language=Javascript1.1 type=text/javascriptJSVersion = 1.1/script script language=Javascript1.2 type=text/javascriptJSVersion = 1.2/script script language=Javascript1.3 type=text/javascriptJSVersion = 1.3/script script language=Javascript1.4 type=text/javascriptJSVersion = 1.4/script script language=Javascript1.5 type=text/javascriptJSVersion = 1.5/script script language=Javascript type=text/javascript!-- // Default all Values to Zero ColorDepth = 0; ResHeight = 0; ResWidth = 0; ResAvailHeight = 0; ResAvailWidth = 0; ResBrowserHeight = 0; ResBrowserWidth = 0; // Get the basic values if (JSVersion 1.1) { ColorDepth = screen.colorDepth; ResHeight = screen.height; ResWidth = screen.width; ResAvailHeight = screen.availHeight; ResAvailWidth = screen.availWidth; }; // Try to get the Browser Window info // If the innerwidth property is set then try to use that - supported by Netscape and several other browsers if( typeof( window.innerWidth ) == 'number' ) { ResBrowserWidth = window.innerWidth; ResBrowserHeight = window.innerHeight; // The following is only supported by IE 6 in some cases. } else if( ( typeof( document.documentElement.clientWidth ) == 'number' ) ( document.documentElement.clientWidth 0 ) ) { ResBrowserWidth = document.documentElement.clientWidth; ResBrowserHeight = document.documentElement.clientHeight; // Finally test if we're IE and use the IE specific values } else if( document.body ( document.body.clientWidth || document.body.clientHeight ) ) { ResBrowserWidth = document.body.clientWidth; ResBrowserHeight = document.body.clientHeight; }; // Create the call to the image document.write(img src='FauxGIF.cfm?ScreenData=JS + JSVersion + , + ColorDepth + , + ResHeight + , + ResWidth + , + ResAvailHeight + , + ResAvailWidth + , + ResBrowserHeight + , + ResBrowserWidth + ' width='1' height='1' alt='' border='0'); //-- /script noscriptimg name=HeartBeat src=FauxGIF.cfm?ScreenData=NoJS,0,0,0,0,0,0,0 width=1 height=1 alt= border=0/noscript ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225573 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Know with cf if Javascript is enabled?
If the user has JS turned off, you're JS will not fire, and you won't find anything out about their browser. Am I missing something? -Original Message- From: Jim Davis [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 10:17 AM To: CF-Talk Subject: RE: Know with cf if Javascript is enabled? I've an example of a technique here: http://www.depressedpress.com/Content/Development/ColdFusion/A rticles/GetRes /Index.cfm That code is really old however. The version I'm actually using is wrapped as a custom tag and determines JS version (and whether or not it's enabled) as well. I'll attach the JavaScript of it below. Jim Davis script language=Javascript type=text/javascriptvar JSVersion = 1.0/script script language=Javascript1.1 type=text/javascriptJSVersion = 1.1/script script language=Javascript1.2 type=text/javascriptJSVersion = 1.2/script script language=Javascript1.3 type=text/javascriptJSVersion = 1.3/script script language=Javascript1.4 type=text/javascriptJSVersion = 1.4/script script language=Javascript1.5 type=text/javascriptJSVersion = 1.5/script script language=Javascript type=text/javascript!-- // Default all Values to Zero ColorDepth = 0; ResHeight = 0; ResWidth = 0; ResAvailHeight = 0; ResAvailWidth = 0; ResBrowserHeight = 0; ResBrowserWidth = 0; // Get the basic values if (JSVersion 1.1) { ColorDepth = screen.colorDepth; ResHeight = screen.height; ResWidth = screen.width; ResAvailHeight = screen.availHeight; ResAvailWidth = screen.availWidth; }; // Try to get the Browser Window info // If the innerwidth property is set then try to use that - supported by Netscape and several other browsers if( typeof( window.innerWidth ) == 'number' ) { ResBrowserWidth = window.innerWidth; ResBrowserHeight = window.innerHeight; // The following is only supported by IE 6 in some cases. } else if( ( typeof( document.documentElement.clientWidth ) == 'number' ) ( document.documentElement.clientWidth 0 ) ) { ResBrowserWidth = document.documentElement.clientWidth; ResBrowserHeight = document.documentElement.clientHeight; // Finally test if we're IE and use the IE specific values } else if( document.body ( document.body.clientWidth || document.body.clientHeight ) ) { ResBrowserWidth = document.body.clientWidth; ResBrowserHeight = document.body.clientHeight; }; // Create the call to the image document.write(img src='FauxGIF.cfm?ScreenData=JS + JSVersion + , + ColorDepth + , + ResHeight + , + ResWidth + , + ResAvailHeight + , + ResAvailWidth + , + ResBrowserHeight + , + ResBrowserWidth + ' width='1' height='1' alt='' border='0'); //-- /script noscriptimg name=HeartBeat src=FauxGIF.cfm?ScreenData=NoJS,0,0,0,0,0,0,0 width=1 height=1 alt= border=0/noscript This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225575 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Know with cf if Javascript is enabled?
I use something to test if pop-ups are not disabled, could usi it as well for javascript. In the login page, I have a script that opens a pop-up. The template called sets up a session variable that says pop-up enabled. Then the code returned closes the pop-up. By the time the user logs in, if the session variable is not set, the user gets an advice to let pop-up for this domain, since they are used in some admin modules. For just Javascript enabled, it could be more elegant to use XMLHttpRequest than a pop-up, but the basic idea is the same. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225577 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Know with cf if Javascript is enabled?
thanks guys. After discussing it some more we found that the easiest thing for now is to just use the noscript, which is working, I was doing something silly before. We probably will change it later, but this works fine for now. Thanks for all the help guys, its appreciated. On 11/29/05, Munson, Jacob [EMAIL PROTECTED] wrote: If the user has JS turned off, you're JS will not fire, and you won't find anything out about their browser. Am I missing something? -Original Message- From: Jim Davis [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 10:17 AM To: CF-Talk Subject: RE: Know with cf if Javascript is enabled? I've an example of a technique here: http://www.depressedpress.com/Content/Development/ColdFusion/A rticles/GetRes /Index.cfm That code is really old however. The version I'm actually using is wrapped as a custom tag and determines JS version (and whether or not it's enabled) as well. I'll attach the JavaScript of it below. Jim Davis script language=Javascript type=text/javascriptvar JSVersion = 1.0/script script language=Javascript1.1 type=text/javascriptJSVersion = 1.1/script script language=Javascript1.2 type=text/javascriptJSVersion = 1.2/script script language=Javascript1.3 type=text/javascriptJSVersion = 1.3/script script language=Javascript1.4 type=text/javascriptJSVersion = 1.4/script script language=Javascript1.5 type=text/javascriptJSVersion = 1.5/script script language=Javascript type=text/javascript!-- // Default all Values to Zero ColorDepth = 0; ResHeight = 0; ResWidth = 0; ResAvailHeight = 0; ResAvailWidth = 0; ResBrowserHeight = 0; ResBrowserWidth = 0; // Get the basic values if (JSVersion 1.1) { ColorDepth = screen.colorDepth; ResHeight = screen.height; ResWidth = screen.width; ResAvailHeight = screen.availHeight; ResAvailWidth = screen.availWidth; }; // Try to get the Browser Window info // If the innerwidth property is set then try to use that - supported by Netscape and several other browsers if( typeof( window.innerWidth ) == 'number' ) { ResBrowserWidth = window.innerWidth; ResBrowserHeight = window.innerHeight; // The following is only supported by IE 6 in some cases. } else if( ( typeof( document.documentElement.clientWidth ) == 'number' ) ( document.documentElement.clientWidth 0 ) ) { ResBrowserWidth = document.documentElement.clientWidth; ResBrowserHeight = document.documentElement.clientHeight; // Finally test if we're IE and use the IE specific values } else if( document.body ( document.body.clientWidth || document.body.clientHeight ) ) { ResBrowserWidth = document.body.clientWidth; ResBrowserHeight = document.body.clientHeight; }; // Create the call to the image document.write(img src='FauxGIF.cfm?ScreenData=JS + JSVersion + , + ColorDepth + , + ResHeight + , + ResWidth + , + ResAvailHeight + , + ResAvailWidth + , + ResBrowserHeight + , + ResBrowserWidth + ' width='1' height='1' alt='' border='0'); //-- /script noscriptimg name=HeartBeat src=FauxGIF.cfm?ScreenData=NoJS,0,0,0,0,0,0,0 width=1 height=1 alt= border=0/noscript This transmission may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. A1. ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225581 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Know with cf if Javascript is enabled?
-Original Message- From: Munson, Jacob [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 12:21 PM To: CF-Talk Subject: RE: Know with cf if Javascript is enabled? If the user has JS turned off, you're JS will not fire, and you won't find anything out about their browser. Am I missing something? Yup. ;^) The noscript tag (at the end) will still run and submit values of noJS and zeros for everything else. In my case I add the value to the session and only output this code if the values don't exist in the session so as not to make a lot of unneeded calls. It works pretty well for me. Jim Davis ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225583 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: CF and JavaScript Form Question
That's how I would have done it, were I coding from scratch. But I'm working with someone's old code, so I'm somewhat limited, if I don't want to rewrite the action page. And I don't as it's due tomorrow. I think I'll go with the list in the URL. It should work. Guy McDowell Web Developer [EMAIL PROTECTED] - Magma Communications Ltd. t: 613.228.3565 x6348 f: 613.228.8313 http://websites.magma.ca This e-mail message is confidential, may be privileged and is intended for the exclusive use of the addressee.Any other person is strictly prohibited from disclosing, distributing or reproducing it.If the addressee cannot be reached or is unknown to you, please inform the sender by return e-mail immediately and delete this e-mail message and destroy all copies.Due to the inherent risks associated with the Internet, we assume no responsibility for unauthorized interception of any Internet communication with you or the transmission of computer viruses.Thank you. Michael Traher [EMAIL PROTECTED] wrote on 25/09/2004 08:30:38 AM: Hi Guy, Sorry about your Dad, thats a tough one we all have to face. On your question; why not just submit the form to an action page in the normal way? i.e. form name=#dynamicName# action="" method=post in the action page you can loop through the #form# structure and all your dynamic form fields will be there. You can use structure functions such as structKeyList() if you need to know the names of the form fields. Hope that is of some help. Michael - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Fri, 24 Sep 2004 19:49:53 -0400 Subject: CF and _javascript_ Form Question To: CF-Talk [EMAIL PROTECTED] Goal : To take form values from the dynamically generated, and named, form elements and pass those values onto an action page. Intended Course: Write the variables to a CF Array or Structure, client side through a _javascript_ function - WDDX serialize that Array into a client scope WDDX - Deserialize the WDDX Packet on the action page. Challenge: I absolutely suck at _javascript_. I thought I knew something - turns out I don't. Code in Question: cfset i=1 CFLOOP QUERY=getSize font face=Verdana, Monaco, Arial, Helvetica Size=1Qty. of #MakeSize#:/fontnbsp; input type=hidden value= name=MakeSize_#ValueID# size=4 input type=text value= name=qty_#i# size=4br cfset i= (i+1) /CFLOOP NOTE: MakeSize is the String Equiv of Value_ID ie. ValueID =24 then MakeSize = Large, ValueID = 23 then MakeSize = Small, etc Question: What's the quickest way to do this? This could generate 0 - 15 or so form elements, so I think URL variables are out. Maybe not. Possibly put these into a list and pass that in the URL and parse it out on the other side? If so - how? Am I out to lunch with the WDDX idea? If not, where could I go to see how to create a CF Array or Struct via a _javascript_ function? Personal Note: Not thinking well - my first B-day without my dad. First everything after losing someone always sucks. Yeah, I'm a heart-on-my-sleeve guy. Guy McDowell Web Developer [EMAIL PROTECTED] - Magma Communications Ltd. t: 613.228.3565 x6348 f: 613.228.8313 http://websites.magma.ca This e-mail message is confidential, may be privileged and is intended for the exclusive use of the addressee.Any other person is strictly prohibited from disclosing, distributing or reproducing it.If the addressee cannot be reached or is unknown to you, please inform the sender by return e-mail immediately and delete this e-mail message and destroy all copies.Due to the inherent risks associated with the Internet, we assume no responsibility for unauthorized interception of any Internet communication with you or the transmission of computer viruses.Thank you. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: CF and JavaScript Form Question
Hi Guy, Sorry about your Dad, thats a tough one we all have to face. On your question; why not just submit the form to an action page in the normal way? i.e. form name=#dynamicName# action="" method=post in the action page you can loop through the #form# structure and all your dynamic form fields will be there. You can use structure functions such as structKeyList() if you need to know the names of the form fields. Hope that is of some help. Michael - Original Message - From: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Fri, 24 Sep 2004 19:49:53 -0400 Subject: CF and _javascript_ Form Question To: CF-Talk [EMAIL PROTECTED] Goal : To take form values from the dynamically generated, and named, form elements and pass those values onto an action page. Intended Course: Write the variables to a CF Array or Structure, client side through a _javascript_ function - WDDX serialize that Array into a client scope WDDX - Deserialize the WDDX Packet on the action page. Challenge: I absolutely suck at _javascript_. I thought I knew something - turns out I don't. Code in Question: cfset i=1 CFLOOP QUERY=getSize font face=Verdana, Monaco, Arial, Helvetica Size=1Qty. of #MakeSize#:/fontnbsp; input type=hidden value= name=MakeSize_#ValueID# size=4 input type=text value= name=qty_#i# size=4br cfset i= (i+1) /CFLOOP NOTE: MakeSize is the String Equiv of Value_ID ie. ValueID =24 then MakeSize = Large, ValueID = 23 then MakeSize = Small, etc Question: What's the quickest way to do this? This could generate 0 - 15 or so form elements, so I think URL variables are out. Maybe not. Possibly put these into a list and pass that in the URL and parse it out on the other side? If so - how? Am I out to lunch with the WDDX idea? If not, where could I go to see how to create a CF Array or Struct via a _javascript_ function? Personal Note: Not thinking well - my first B-day without my dad. First everything after losing someone always sucks. Yeah, I'm a heart-on-my-sleeve guy. Guy McDowell Web Developer [EMAIL PROTECTED] - Magma Communications Ltd. t: 613.228.3565 x6348 f: 613.228.8313 http://websites.magma.ca This e-mail message is confidential, may be privileged and is intended for the exclusive use of the addressee.Any other person is strictly prohibited from disclosing, distributing or reproducing it.If the addressee cannot be reached or is unknown to you, please inform the sender by return e-mail immediately and delete this e-mail message and destroy all copies.Due to the inherent risks associated with the Internet, we assume no responsibility for unauthorized interception of any Internet communication with you or the transmission of computer viruses.Thank you. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
CF and JavaScript Form Question
Goal : To take form values from the dynamically generated, and named, form elements and pass those values onto an action page. Intended Course: Write the variables to a CF Array or Structure, client side through a _javascript_ function - WDDX serialize that Array into a client scope WDDX - Deserialize the WDDX Packet on the action page. Challenge: I absolutely suck at _javascript_. I thought I knew something - turns out I don't. Code in Question: cfset i=1 CFLOOP QUERY=getSize font face=Verdana, Monaco, Arial, Helvetica Size=1Qty. of #MakeSize#:/fontnbsp; input type=hidden value= name=MakeSize_#ValueID# size=4 input type=text value= name=qty_#i# size=4br cfset i= (i+1) /CFLOOP NOTE: MakeSize is the String Equiv of Value_ID ie. ValueID =24 then MakeSize = Large, ValueID = 23 then MakeSize = Small, etc Question: What's the quickest way to do this? This could generate 0 - 15 or so form elements, so I think URL variables are out. Maybe not. Possibly put these into a list and pass that in the URL and parse it out on the other side? If so - how? Am I out to lunch with the WDDX idea? If not, where could I go to see how to create a CF Array or Struct via a _javascript_ function? Personal Note: Not thinking well - my first B-day without my dad. First everything after losing someone always sucks. Yeah, I'm a heart-on-my-sleeve guy. Guy McDowell Web Developer [EMAIL PROTECTED] - Magma Communications Ltd. t: 613.228.3565 x6348 f: 613.228.8313 http://websites.magma.ca This e-mail message is confidential, may be privileged and is intended for the exclusive use of the addressee.Any other person is strictly prohibited from disclosing, distributing or reproducing it.If the addressee cannot be reached or is unknown to you, please inform the sender by return e-mail immediately and delete this e-mail message and destroy all copies.Due to the inherent risks associated with the Internet, we assume no responsibility for unauthorized interception of any Internet communication with you or the transmission of computer viruses.Thank you. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question - Thanks
Hey, Does anyone know where I can get a breakdown of this syntax? I would love to learn to use this kind of shorthand when I have those long lists of if / thens. :-) Thanks, Kevin _ Although I am far from being a _javascript_ expert but I think (val==null)?:val; acts like a immediate if or IIF. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question - Thanks
Does anyone know where I can get a breakdown of this syntax? see http://msdn.microsoft.com/library/en-us/jscript7/html/jsoprconditional.asp -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question - Thanks
From the Netscape _javascript_ 1.3 Client Reference ?: (Conditional operator) The conditional operator is the only _javascript_ operator that takes three operands. This operator is frequently used as a shortcut for the if statement. Syntax condition ? expr1 : expr2 Parameters condition : an _expression_ that evaluates to true or false expr1,expr2 : Expressions with values of any type. Description If condition is true, the operator returns the value of expr1; otherwise, it returns the value of expr2. For example, to display a different message based on the value of the isMember variable, you could use this statement: document.write (The fee is + (isMember ? $2.00 : $10.00)) Marlon -Original Message- From: Kevin [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 27, 2004 5:13 PM To: CF-Talk Subject: RE: HELP. CF and _javascript_ question - Thanks Hey, Does anyone know where I can get a breakdown of this syntax? I would love to learn to use this kind of shorthand when I have those long lists of if / thens. :-) Thanks, Kevin _ Although I am far from being a _javascript_ expert but I think (val==null)?:val; acts like a immediate if or IIF. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
HELP. CF and JavaScript question
Hi all, I have a problem. I have a page that I want to populate a section of the form with data from my database based on the selection in a drop down list. I have got the query to pull the records and use that to populate the pull down list. I know that to change the values of the fields with the matching data I need to use _javascript_ but I don't know how to get the records from the query recordset into a _javascript_ array. I figure that if I have all the records in an array I can set the value property of each of the matching form fields from the array. First am I on the right track and second, How do I move the records from the query to the array in _javascript_? Thanks, Kevin [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
You can use cfwddx to create JS objects/arrays from CF variables. If you use the query directly, you will need to have the JS wddx object in your page. Find more info in the cf docs: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/xml51.htm Pascal -Original Message- From: Kevin [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 10:16 To: CF-Talk Subject: HELP. CF and _javascript_ question Hi all, I have a problem. I have a page that I want to populate a section of the form with data from my database based on the selection in a drop down list. I have got the query to pull the records and use that to populate the pull down list. I know that to change the values of the fields with the matching data I need to use _javascript_ but I don't know how to get the records from the query recordset into a _javascript_ array. I figure that if I have all the records in an array I can set the value property of each of the matching form fields from the array. First am I on the right track and second, How do I move the records from the query to the array in _javascript_? Thanks, Kevin [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Kevin 1) Are you talking about populating something like 3 selects related 2) do you want populate it in CF then change it in _javascript_ 3) How much data are we talking about 4) Why do you think you need it in a _javascript_ array The reason I ask, is that there are several alternatives, that, based on your answers. Dick The reason there are two senators for each state is so that one can be the designated driver. -Jay Leno - On Jul 26, 2004, at 1:15 AM, Kevin wrote: Hi all, I have a problem. I have a page that I want to populate a section of the form with data from my database based on the selection in a drop down list. I have got the query to pull the records and use that to populate the pull down list. I know that to change the values of the fields with the matching data I need to use _javascript_ but I don't know how to get the records from the query recordset into a _javascript_ array. I figure that if I have all the records in an array I can set the value property of each of the matching form fields from the array. First am I on the right track and second, How do I move the records from the query to the array in _javascript_? Thanks, Kevin [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
Thanks Pascal, I read the pages on the wddx object and got the query loaded into an array. Problem is I am now unsure how to reference it. :-( Unfortunately the docs are not very specific on the syntax to actually use and reference the array. Or at least not to a newbie. :-( If I post the code generated by it that builds the array, can someone help me match the proper array element to the menu selection? Thanks, Kevin _ You can use cfwddx to create JS objects/arrays from CF variables. If you use the query directly, you will need to have the JS wddx object in your page. Find more info in the cf docs: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/xml51.htm Pascal [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
Hi Dick, What I am doing is this. I am creating an Order Entry form and when the user selects the customer from the list created from the query the address and other customer information is then filled in automatically. I am talking about a total of 5 fields that need to be filled in. I had figured that if I placed empty text input boxes where the data was to go, I could then use _javascript_ to change their values to match the customer id selected. I was going to call the function using the onChange property of the dropdown list. Being very new to ColdFusion programming I am not sure if I am making this harder then it needs to be. :-( HELP please. I am begging here. ;-) Thanks, Kevin _ Kevin 1) Are you talking about populating something like 3 selects related 2) do you want populate it in CF then change it in _javascript_ 3) How much data are we talking about 4) Why do you think you need it in a _javascript_ array The reason I ask, is that there are several alternatives, that, based on your answers. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Do you know how to do _javascript_ arrays? Wrap your _javascript_ array creation code in a CFOUTPUT and create them in CF, the browser will load the page and create the _javascript_ array. rough example: script // create your _javascript_ array CFOUTPUT QUERY=your query somejsarray[#currentrow#] = '#somefieldname#'; /CFOUTPUT /script HTH Aaron - Original Message - From: Kevin To: CF-Talk Sent: Monday, July 26, 2004 7:35 PM Subject: RE: HELP. CF and _javascript_ question Hi Dick, What I am doing is this. I am creating an Order Entry form and when the user selects the customer from the list created from the query the address and other customer information is then filled in automatically. I am talking about a total of 5 fields that need to be filled in. I had figured that if I placed empty text input boxes where the data was to go, I could then use _javascript_ to change their values to match the customer id selected. I was going to call the function using the onChange property of the dropdown list. Being very new to ColdFusion programming I am not sure if I am making this harder then it needs to be. :-( HELP please. I am begging here. ;-) Thanks, Kevin _ Kevin 1) Are you talking about populating something like 3 selects related 2) do you want populate it in CF then change it in _javascript_ 3) How much data are we talking about 4) Why do you think you need it in a _javascript_ array The reason I ask, is that there are several alternatives, that, based on your answers. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Kevin how many customers in the list? What I am trying to determine is: 1) Is it practical to download the list of customers AND all their data with the page from CF 2) OR Just download the list of customers, have the user select one, then make a request to the server for another page with the fields filled in for that customer. Dick The reason there are two senators for each state is so that one can be the designated driver. -Jay Leno - On Jul 26, 2004, at 2:35 AM, Kevin wrote: Hi Dick, What I am doing is this. I am creating an Order Entry form and when the user selects the customer from the list created from the query the address and other customer information is then filled in automatically. I am talking about a total of 5 fields that need to be filled in. I had figured that if I placed empty text input boxes where the data was to go, I could then use _javascript_ to change their values to match the customer id selected. I was going to call the function using the onChange property of the dropdown list. Being very new to ColdFusion programming I am not sure if I am making this harder then it needs to be. :-( HELP please. I am begging here. ;-) Thanks, Kevin _ Kevin 1) Are you talking about populating something like 3 selects related 2) do you want populate it in CF then change it in _javascript_ 3) How much data are we talking about 4) Why do you think you need it in a _javascript_ array The reason I ask, is that there are several alternatives, that, based on your answers. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
Hi Aaron, Up to this point I had only worked in a one dimensional array. (i.e. bannerImg[0] = somebanner1.gif, bannerImg[1] = somabanner2.gif etc.) Now I need to capture 6 fields for each row. I had thought to do what you outlined but got lost with the multi-dimensional array. Would the code for the 2 dimensional array be like this? CFOUTPUT QUERY=your query customerInfo[#currentrow#][ID] = '#customerID#'; customerInfo[#currentrow#][Name] = '#customerName#'; etc.. /CFOUTPUT I truly appreciate all the help and your patients with me. Thanks, Kevin _ Do you know how to do _javascript_ arrays? Wrap your _javascript_ array creation code in a CFOUTPUT and create them in CF, the browser will load the page and create the _javascript_ array. rough example: script // create your _javascript_ array CFOUTPUT QUERY=your query somejsarray[#currentrow#] = '#somefieldname#'; /CFOUTPUT /script HTH Aaron [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Aaron That's OK for small arrays, but for large arrays it is a real hog of bandwidth and client-side memory cycles (similar to the way WDDX does it). Dick The reason there are two senators for each state is so that one can be the designated driver. -Jay Leno - On Jul 26, 2004, at 2:47 AM, Aaron DC wrote: Do you know how to do _javascript_ arrays? Wrap your _javascript_ array creation code in a CFOUTPUT and create them in CF, the browser will load the page and create the _javascript_ array. rough example: script // create your _javascript_ array CFOUTPUT QUERY=your query somejsarray[#currentrow#] = '#somefieldname#'; /CFOUTPUT /script HTH Aaron - Original Message - From: Kevin To: CF-Talk Sent: Monday, July 26, 2004 7:35 PM Subject: RE: HELP. CF and _javascript_ question Hi Dick, What I am doing is this. I am creating an Order Entry form and when the user selects the customer from the list created from the query the address and other customer information is then filled in automatically. I am talking about a total of 5 fields that need to be filled in. I had figured that if I placed empty text input boxes where the data was to go, I could then use _javascript_ to change their values to match the customer id selected. I was going to call the function using the onChange property of the dropdown list. Being very new to ColdFusion programming I am not sure if I am making this harder then it needs to be. :-( HELP please. I am begging here. ;-) Thanks, Kevin _ Kevin 1) Are you talking about populating something like 3 selects related 2) do you want populate it in CF then change it in _javascript_ 3) How much data are we talking about 4) Why do you think you need it in a _javascript_ array The reason I ask, is that there are several alternatives, that, based on your answers. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
Hi again, Well, the number of customers are probably going to be around 10 - 20 to start, but I am not sure of the totals as I had neglected to ask that question. :-( For now I would feel safe with 50 as a total number of customers. The only information I am going to need to pull in is the customer name, address and phone info. If at all possible I would like not to have to use a 2nd page to list that info and collect the balance of the order header. Thanks!!! Kevin _ Kevin how many customers in the list? What I am trying to determine is: 1) Is it practical to download the list of customers AND all their data with the page from CF 2) OR Just download the list of customers, have the user select one, then make a request to the server for another page with the fields filled in for that customer. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
OK You could do it with WDDX -- CF has a tag, cfwddx, that converts/transmits CF arrays on the server to _javascript_ arrays on the client. CFWDDX is the easiest way to go if you have a small number of users and a small amount of data. CFWDDX sends/receives the data and the _javascript_ code (about 22K) to manipulate the data on the client. Your data would be about 100 characters for each customer, so: 100 x 50 customers = 5,000 characters of raw data for 50 customers 5,000 x 256% wddx packet (XML) overhead * = 12,800 of data and XML 12,800 data XML + 12k wddx js code = approximately 25K of data being sent, over and above the html in the page. So, how many of these 25K hitsdo you expect concurrently. If just a few, WDDX is prolly OK. But if the number of customers or number of concurrent users grows significantly, you will have a bandwidth problem. There are other ways to accomplish this at much less overhead -- one is the concept of thinArrays, This is an open-source solution that requires a little (not much) more work on your part than the wddx tag I will send you a write off list because it is too big to post. Then look at cfwddx vs thinArrays decide what's best for you. * the 256% wddx overhead is approximate, but was observed in several typical applications By contrast, thinArrays add approcimately 13% Overhead HTH Dick The reason there are two senators for each state is so that one can be the designated driver. -Jay Leno - On Jul 26, 2004, at 3:04 AM, Kevin wrote: Hi again, Well, the number of customers are probably going to be around 10 - 20 to start, but I am not sure of the totals as I had neglected to ask that question. :-( For now I would feel safe with 50 as a total number of customers. The only information I am going to need to pull in is the customer name, address and phone info. If at all possible I would like not to have to use a 2nd page to list that info and collect the balance of the order header. Thanks!!! Kevin _ Kevin how many customers in the list? What I am trying to determine is: 1) Is it practical to download the list of customers AND all their data with the page from CF 2) OR Just download the list of customers, have the user select one, then make a request to the server for another page with the fields filled in for that customer. Dick [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Yes Kevin, that is exactly the way you would do it... I think. Do a google on 2 dimensional _javascript_ array to get the syntax just right. As a suggestion, give it a go anyway, and see what happens :) the worst that can happen is you get errors and we'll help you with them. You cant break anything or commmit any gross crimes playing with this stuff, cut loose and give it a go :) HTH Aaron - Original Message - From: Kevin To: CF-Talk Sent: Monday, July 26, 2004 7:59 PM Subject: RE: HELP. CF and _javascript_ question Hi Aaron, Up to this point I had only worked in a one dimensional array. (i.e. bannerImg[0] = somebanner1.gif, bannerImg[1] = somabanner2.gif etc.) Now I need to capture 6 fields for each row. I had thought to do what you outlined but got lost with the multi-dimensional array. Would the code for the 2 dimensional array be like this? CFOUTPUT QUERY=your query customerInfo[#currentrow#][ID] = '#customerID#'; customerInfo[#currentrow#][Name] = '#customerName#'; etc.. /CFOUTPUT I truly appreciate all the help and your patients with me. Thanks, Kevin _ Do you know how to do _javascript_ arrays? Wrap your _javascript_ array creation code in a CFOUTPUT and create them in CF, the browser will load the page and create the _javascript_ array. rough example: script // create your _javascript_ array CFOUTPUT QUERY=your query somejsarray[#currentrow#] = '#somefieldname#'; /CFOUTPUT /script HTH Aaron [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
I'm curious how cfwddx is easier than the cfoutput junk code sample i submitted. Aaron - Original Message - From: Dick Applebaum To: CF-Talk Sent: Monday, July 26, 2004 8:42 PM Subject: Re: HELP. CF and _javascript_ question OK You could do it with WDDX -- CF has a tag, cfwddx, that converts/transmits CF arrays on the server to _javascript_ arrays on the client. CFWDDX is the easiest way to go if you have a small number of users and a small amount of data. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
Something like this: cfquery name=q datasource=#dsn# SELECT id, name, address,phone FROM users /cfquery !--- Load the wddx.js file --- script type=text/_javascript_ src=""> script // Use WDDX to move from CFML data to _javascript_ cfwddx action="" input=#q# topLevelVariable=qj function Populate(f){ var i = f.User.selectedIndex - 1; // take the blank option into account f.UserAddress.value = qj.getField(i,address); f.UserPhone.value = qj.getField(i,phone); } /script form action="" method=post Customer: select name=User size=1 > option value=- select one -/option cfoutput query=q option value=#q.name##q.name#/option /cfoutput /selectbr/ Address: input name=UserAddress type=text readonly=truebr/ Phone: input name=UserPhone type=text readonly=truebr/ ... /form Pascal -Original Message- From: Kevin [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 11:31 To: CF-Talk Subject: RE: HELP. CF and _javascript_ question Thanks Pascal, I read the pages on the wddx object and got the query loaded into an array. Problem is I am now unsure how to reference it. :-( Unfortunately the docs are not very specific on the syntax to actually use and reference the array. Or at least not to a newbie. :-( If I post the code generated by it that builds the array, can someone help me match the proper array element to the menu selection? [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question
The function is not correct: function Populate(f){ var i = f.User.selectedIndex - 1; // take the blank option into account if(i0){ f.UserAddress.value = ; f.UserPhone.value = ; } else{ f.UserAddress.value = qj.getField(i,address); f.UserPhone.value = qj.getField(i,phone); } } Pascal -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 13:59 To: CF-Talk Subject: RE: HELP. CF and _javascript_ question Something like this: cfquery name=q datasource=#dsn# SELECT id, name, address,phone FROM users /cfquery !--- Load the wddx.js file --- script type=text/_javascript_ src=""> script // Use WDDX to move from CFML data to _javascript_ cfwddx action="" input=#q# topLevelVariable=qj function Populate(f){ var i = f.User.selectedIndex - 1; // take the blank option into account f.UserAddress.value = qj.getField(i,address); f.UserPhone.value = qj.getField(i,phone); } /script form action="" method=post Customer: select name=User size=1 > option value=- select one -/option cfoutput query=q option value=#q.name##q.name#/option /cfoutput /selectbr/ Address: input name=UserAddress type=text readonly=truebr/ Phone: input name=UserPhone type=text readonly=truebr/ ... /form Pascal [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question - Thanks
Hey Peter! THANKS!!! I was able to decipher the code and adapt it t my form design and query. Now that I have implemented it once I shall be able to do this again on my own. I thank you from the bottom of my heart! You saved my day. :-D I have one more question if you don't mind. On some one of the fields it is possible to have a null value. (addressLine2) In those cases it places null into the field value. Is there a simple check I can place inside the Populate function to replace the null with a blank space? Something like: If(qj.getField(I,addressLine2) = ) { f.addressLine2.value = ; } else { f.addressLine2.value = qj.getField(i,addressLine2); } Thanks, Kevin _ Something like this: cfquery name=q datasource=#dsn# SELECT id, name, address,phone FROM users /cfquery !--- Load the wddx.js file --- script type=text/_javascript_ src=""> script // Use WDDX to move from CFML data to _javascript_ cfwddx action="" input=#q# topLevelVariable=qj function Populate(f){ var i = f.User.selectedIndex - 1; // take the blank option into account f.UserAddress.value = qj.getField(i,address); f.UserPhone.value = qj.getField(i,phone); } /script form action="" method=post Customer: select name=User size=1 > option value=- select one -/option cfoutput query=q option value=#q.name##q.name#/option /cfoutput /selectbr/ Address: input name=UserAddress type=text readonly=truebr/ Phone: input name=UserPhone type=text readonly=truebr/ ... /form Pascal [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question - Thanks
Does it actually have the string null?? In that case: function ReplaceNull(val){ return (val==null)?:val; } ... f.addressLine2.value = ReplaceNull(qj.getField(i,addressLine2)); If it is the null value: function ReplaceNull(val){ return (val==null)?:val; } Pascal -Original Message- From: Kevin [mailto:[EMAIL PROTECTED] Sent: 26 July 2004 15:00 To: CF-Talk Subject: RE: HELP. CF and _javascript_ question - Thanks I have one more question if you don't mind. On some one of the fields it is possible to have a null value. (addressLine2) In those cases it places null into the field value. Is there a simple check I can place inside the Populate function to replace the null with a blank space? Something like: If(qj.getField(I,addressLine2) = ) { f.addressLine2.value = ; } else { f.addressLine2.value = qj.getField(i,addressLine2); } [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question
Well, WDDX gives you some well defined and documented ways of handling a recordset with _javascript_, on the client -- and approximates the way you handle a recordset with CF. In fact, if you look at the code that cfwddx generates it is similar to yours: // Use WDDX to move from CFML data to _javascript_ qj = new WddxRecordset(); col0 = new Array(); col0[0] = 1; col0[1] = 2; * * * col0[13] = 14; col0[14] = 15; qj[emp_id] = col0; col0 = null; col1 = new Array(); col1[0] = Peterson; col1[1] = Heartsdale; * * * col1[13] = Reardon; col1[14] = Barnes; The extra array gives an approximation of the record set. But, setting each array entry, individually (your example or wddx) is verbose(256% overhead, observed in bandwidth RAM) and inefficient (parse/serialize/deserialize) You could do it all with 13% overhead and 1 js command and 1 array: myList = 1|2|...|13|14|Peterson|Heartsdale|...|Reardon|Barnes|...|; myArray= myList.split('|'); I generalized this a little into a concept I call thinArray. which looks like this (you should display this in a fixed-width font, and no wrap): |6 | Emp_ID | LastName | FirstName | Department | Phone | email | 1 | Peterson | Carolyn | Sales | (612) 832-7654 | CPETERSON | 2 | Smith | .. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question - Thanks
Does it actually have the string null?? The function returns an empty string if the argument (val) is the string null, or the argument itself if not. -- ___ REUSE CODE! Use custom tags; See http://www.contentbox.com/claude/customtags/tagstore.cfm (Please send any spam to this address: [EMAIL PROTECTED]) Thanks. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question Part II
Well, looks like Michael is enforcing message length I generalized this a little into a concept I call thinArray. which looks like this (you should display this in a fixed-width font, and no wrap): |6 | Emp_ID | LastName | FirstName | Department | Phone | email | 1 | Peterson | Carolyn | Sales | (612) 832-7654 | CPETERSON | 2 | Smith | .. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question Part II fixed?
Not Michael's fault -- some thing doesn't handle a caret (UC6) symbol-- here's a third try. I generalized this a little into a concept I call thinArray. which looks like this (you should display this in a fixed-width font, and no wrap): |6 | Emp_ID | LastName | FirstName | Department | Phone | email | 1 | Peterson | Carolyn | Sales | (612) 832-7654 | CPETERSON | 2 | Smith | .. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question Part II fixed?
Not the caret -- final try (diagram last) I generalized this a little into a concept I call thinArray. which looks like this (you should display this in a fixed-width font, and no wrap): Refers to the diagram at the end: This is just a string repreesntation of a List with some special content: the first character denotes the field separator the first list element (after the field-separator) denotes the number of columns (c) in this grid the next c elements denote the column names (essentialy the first, or header row, of our grid) the next n elements (in groups of c columns) represent the rows of our grid. I wrote some CFC's to handle serialization/deserialization of cf queries and arrays to thin arrays. Rob Rohan wrote some js code to do the equivalent, and to manipulate the js array. This is all open source -- part of Rob's Neuromancer package, available at: http://rohanclan.com/products/neuromancer/ Requires a modern browser (Mozilla, Firefox (and I think IE 6)). HTH Dick The reason there are two senators for each state is so that one can be the designated driver. -Jay Leno - |6 | Emp_ID | LastName | FirstName | Department | Phone | email | 1 | Peterson | Carolyn | Sales | (612) 832-7654 | CPETERSON | 2 | Smith | .. AA A AA A AAA AAA A || | |! ! !!! !|| | ||+-+--+-+-+--+---+ +--+--+-+--+---+-+ +-+---+... ||| | ||| | ||--+ -- ||Grid Column Names A Row of Grid Data || (information for 1 employee) || |+- # of Columns in this Grid ! ! +--- Unique Field Separator for this Grid - | (pipe) is the default [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: HELP. CF and JavaScript question - Thanks
Hey Pascal, It was the null value that for some reason was outputting as a string null. Funny thing was it only happened on the records that I had entered using Access. The records I entered with my CF form and no value in that field came out fine. In any case I added the function and the extra code to that line (and a few others I wanted to make sure had nothing for output is there was a null value g) and all works great. I did want to ask a question on the syntax you used in the function. I looked and searched the _javascript_ Docs and google and could not get any explanation to my question. Return(val==null)?:val; What is the [?:val ]code doing? Thanks again, Kevin _ Does it actually have the string null?? In that case: function ReplaceNull(val){ return (val==null)?:val; } ... f.addressLine2.value = ReplaceNull(qj.getField(i,addressLine2)); If it is the null value: function ReplaceNull(val){ return (val==null)?:val; } Pascal [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: HELP. CF and JavaScript question - Thanks
Although I am far from being a _javascript_ expert but I think (val==null)?:val; acts like a immediate if or IIF. - Original Message - From: Kevin [EMAIL PROTECTED] Date: Mon, 26 Jul 2004 17:13:15 -0400 Subject: RE: HELP. CF and _javascript_ question - Thanks To: CF-Talk [EMAIL PROTECTED] Hey Pascal, It was the null value that for some reason was outputting as a string null. Funny thing was it only happened on the records that I had entered using Access. The records I entered with my CF form and no value in that field came out fine. In any case I added the function and the extra code to that line (and a few others I wanted to make sure had nothing for output is there was a null value g) and all works great. I did want to ask a question on the syntax you used in the function. I looked and searched the _javascript_ Docs and google and could not get any explanation to my question. Return(val==null)?:val; What is the [?:val ]code doing? Thanks again, Kevin _ Does it actually have the string null?? In that case: function ReplaceNull(val){ return (val==null)?:val; } f.addressLine2.value = ReplaceNull(qj.getField(i,addressLine2)); If it is the null value: function ReplaceNull(val){ return (val==null)?:val; } Pascal [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
checking form elements in CF with JavaScript
Hi all, Im trying to use a simple _javascript_ form validation with my CF code. The validation should check both text fields and radio buttons/checkboxes. So far the radio button part does not work. This is the code: script language='_javascript_' !-- function check_form() { for (i = 0; i document.forms[0].elements.length; i++) { checkElement = document.forms[0].elements[i]; if (checkElement.name == 'InstEthn') {if (checkElement.value.length 255) { alert(text too long.); return false;} } if (checkElement.name == 'InstLang') {if (checkElement.value.length 255) { alert(text too long.); return false;} } if (checkElement.name == 'InstEthn') {if (checkElement.value.length 1) { alert(The Instructor Ethnicity field is empty.); return false;}} if (checkElement.name == 'InstLang') {if (checkElement.value.group1 == undefined) { alert(Question 3 was not answered.); return false;}} As it is now, the InstLang field gives the user the Question 3 was not answered message, even when that radio button is checked. Any alternatives/fixes for this code? Thanks a lot, Roberto Perez [EMAIL PROTECTED] [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: checking form elements in CF with JavaScript
Try checking for the checked attribute instead of the value attribute. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: CF and JavaScript HELP - Maybe OT?
Forgot to mention we're stuck in CF 4.0, but thanks for the response. Nice to know someone cares ; ). I think I'll have to manually escape each special character withcfset mystring = Replace(mystring, ', \', ALL) Maybe you have a better solution? John -Original Message- From: Ubqtous [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 9:50 PM To: CF-Talk Subject: Re: CF and _javascript_ HELP - Maybe OT? John, On Wednesday, January 14, 2004, 4:34:22 PM, you wrote: JG Everything works fine until I get a non alpha-numeric character, JG i.e., ., , ', /, , (, ), in the #WholeName# JG variable. Then, _javascript_ bombs and returns an error: error JG expected ';'. JG Can someone help me with handling regular expressions in JG _javascript_, so the above code will accept special characters in JG the name? Grateful doesn't begin to describe how I'll feel. Perhaps JSStringFormat() would help? ~ Ubqtous ~ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CF and JavaScript HELP - Maybe OT?
John, On 1/15/2004 at 10:07, you wrote: JG I think I'll have to manually escape each special JG character with cfset mystring = Replace(mystring, ', \', JG ALL) JGMaybe you have a better solution? If CF4 supports replacelist(): cfscript mystring=foo to the bar; lstbad=foo,bar; lstgood=\foo,\bar; mystring=replacelist(mystring,lstbad,lstgood); /cfscript This is probably not a very efficient approach if your code is heavily trafficked, but nothing else comes to mind... ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
CF and JavaScript HELP - Maybe OT?
Tough day. Alzheimers is acting up. I have the following _javascript_ code: script language=_javascript_ cfloop query=get_individuals cfoutputcfset valuedata=#cattasc_member_id#/cfoutput cfoutputcfset optiontext=#WholeName#/cfoutput cfoutputc=#currentrow#-1;/cfoutput//599 var nopt = new Option(); cfoutputnopt.value = #valuedata#;/cfoutput cfoutputnopt.text = #optiontext#;/cfoutput parent.frames[0].document.all.individuallist1.options[c] = nopt; /cfloop /script Everything works fine until I get a non alpha-numeric character, i.e., ., , ', /, , (, ), in the #WholeName# variable. Then, _javascript_ bombs and returns an error: error expected ';'. Can someone help me with handling regular expressions in _javascript_, so the above code will accept special characters in the name? Grateful doesn't begin to describe how I'll feel. John Sent via Pastors.com Free WebMail http://www.pastors.com [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: CF and JavaScript HELP - Maybe OT?
John, On Wednesday, January 14, 2004, 4:34:22 PM, you wrote: JG Everything works fine until I get a non alpha-numeric character, JG i.e., ., , ', /, , (, ), in the #WholeName# JG variable. Then, _javascript_ bombs and returns an error: error JG expected ';'. JG Can someone help me with handling regular expressions in JG _javascript_, so the above code will accept special characters in JG the name? Grateful doesn't begin to describe how I'll feel. Perhaps JSStringFormat() would help? ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Editing CF Generated Javascript
Hello, Is there a way to edit the javascript that CF automatically generates in the templates when you use CFFORM and CFINPUT ?? Thanks, Dan Quinones __ Why Share? Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: CF and Javascript Form Question
That did the trick. Thank you so much for the tip Philip. - - - Jeanne From: "Philip Arnold - ASP" [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: RE: CF and Javascript Form Question Date: Tue, 20 Feb 2001 22:43:56 - I have a form that contains fields for both General Contact Info and Billing Contact Info. After the user fills in their General Contact Info, they can click a checkbox called "Same Billing Info" which Prepopulates all of the billing fields w/ the associated General Contact Fields. It works great except for the "state" field which is a drop down that's populated like this: CFSELECT NAME="General_State" REQUIRED="yes" SELECTED="#state#" MESSAGE="Please select your State." QUERY="application.qryState" VALUE="st_abbr" /CFSELECT My javascript is this: function handleClick(){ with (document.myForm){ Billing_Name_First.value = General_Name_First.value Billing_Name_Last.value = General_Name_Last.value Billing_Address.value = General_Address.value Billing_City.value = General_City.value Billing_State.value = General_State.value Billing_Zip.value = General_Zip.value } } Again, all but Billing_State populate with the General Contact Info when the checkbox gets checked. Any suggestions on how to get the Billing_State field to work as well would be greatly appreciated. As long as they're populated from the same query, then it's (relatively) easy; document.myForm.elements["Billing_State"].selectedIndex=document.myForm.elem ents["General_State"].selectedIndex; I tend to use elements[] as a rule, but it could be done as document.myForm.Billing_State.selectedIndex=document.myForm.General_State.se lectedIndex; I haven't tested this, but I'm pretty sure it'll work Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** -Original Message- From: Jeanne Sarfaty Glazer [mailto:[EMAIL PROTECTED]] Sent: 20 February 2001 22:33 To: CF-Talk Subject: CF and Javascript Form Question Hi Everyone, TIA, - - - Jeanne S. Glazer ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
CF and Javascript Form Question
Hi Everyone, I have a form that contains fields for both General Contact Info and Billing Contact Info. After the user fills in their General Contact Info, they can click a checkbox called "Same Billing Info" which Prepopulates all of the billing fields w/ the associated General Contact Fields. It works great except for the "state" field which is a drop down that's populated like this: CFSELECT NAME="General_State" REQUIRED="yes" SELECTED="#state#" MESSAGE="Please select your State." QUERY="application.qryState" VALUE="st_abbr" /CFSELECT My javascript is this: function handleClick(){ with (document.myForm){ Billing_Name_First.value = General_Name_First.value Billing_Name_Last.value = General_Name_Last.value Billing_Address.value = General_Address.value Billing_City.value = General_City.value Billing_State.value = General_State.value Billing_Zip.value = General_Zip.value } } Again, all but Billing_State populate with the General Contact Info when the checkbox gets checked. Any suggestions on how to get the Billing_State field to work as well would be greatly appreciated. TIA, - - - Jeanne S. Glazer ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists