Re: CFMAP/JavaScript help
s'Awsome. On Tue, Jul 6, 2010 at 8:30 AM, Pete Ruckelshaus wrote: > > Thanks Michael, that got me a LOT closer...I just needed to add an eval() > to > your code: > > onChange="ColdFusion.Map.setCenter('map1', > > {latitude:eval(this.value.split('|')[0]),longitude:eval(this.value.split('|')[1])});ColdFusion.Map.setZoomLevel('map1',10);" > > Thanks for the help, > > Pete > > On Tue, Jul 6, 2010 at 8:25 AM, Michael Grant wrote: > > > > > > > > > > I can never remember weather > > > > > > > Errr... whether. It's still early. > > > > > > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335098 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFMAP/JavaScript help
Thanks Michael, that got me a LOT closer...I just needed to add an eval() to your code: onChange="ColdFusion.Map.setCenter('map1', {latitude:eval(this.value.split('|')[0]),longitude:eval(this.value.split('|')[1])});ColdFusion.Map.setZoomLevel('map1',10);" Thanks for the help, Pete On Tue, Jul 6, 2010 at 8:25 AM, Michael Grant wrote: > > > > > > I can never remember weather > > > > Errr... whether. It's still early. > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335097 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFMAP/JavaScript help
> > > I can never remember weather > Errr... whether. It's still early. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335096 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: CFMAP/JavaScript help
I'm going to guess the problem is that the js is seeing your object as a string. I *think* this would work. Can't say for sure without testing it. I can never remember weather you can use this.value with a select and have it work. You may need to change it to this.options[this.selectedIndex].value.split('|')[0] to target the value. Select Location #getMapLocations.name# On Tue, Jul 6, 2010 at 8:09 AM, Pete Ruckelshaus wrote: > > I'm having a bit of trouble getting some JavaScript working with CFMAP. I > currently use a link to center the map and zoom in on a specific location; > this code works fine: > > > href="javascript:ColdFusion.Map.setCenter('map1',{latitude:#getMapLocations.latitude#,longitude:#getMapLocations.longitude#});javascript:ColdFusion.Map.setZoomLevel('map1',10);">Zoom > > Due to the number of locations on the map, I want to provide users with a > way of selecting a location from a dropdown list, and then having the map > zoom and center on the selected location using an onchange event handler in > the select tag. I feel like this would work, but it doesn't: > > > > Select Location > > value="{latitude:#getMapLocations.latitude#,longitude:#getMapLocations.longitude#}">#getMapLocations.name# > > > > > The error that I'm getting is: > > Uncaught ColdFusion.Map.setCenter: center should be a textual address or > latitude/longitude pair, id: map1 > > Any ideas? > > Thanks, > > Pete > > > ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335095 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
CFMAP/JavaScript help
I'm having a bit of trouble getting some JavaScript working with CFMAP. I currently use a link to center the map and zoom in on a specific location; this code works fine: Zoom Due to the number of locations on the map, I want to provide users with a way of selecting a location from a dropdown list, and then having the map zoom and center on the selected location using an onchange event handler in the select tag. I feel like this would work, but it doesn't: Select Location #getMapLocations.name# The error that I'm getting is: Uncaught ColdFusion.Map.setCenter: center should be a textual address or latitude/longitude pair, id: map1 Any ideas? Thanks, Pete ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335093 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: (ot) Javascript Help
> Someone told me that IE cannot talk to an embed tag, only an object tag, but > I believe > the ID vs NAME issue is tripping me up. I don't think IE uses the EMBED tag at all. Give your OBJECT an ID of its own, and use that when you're in IE. 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! ~| 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:324387 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: (ot) Javascript Help
There's probably something in jquery that'll do it on one line of cross browser code... mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ 2009/7/9 Michael Muller : > > Ok, I need some Javascript help. > > I just cannot get this script (residing in an iframe)... > > > > parent.thisMovie('studio_loader_embed').reloadClipart(); > parent.thisMovie('studio_loader_embed').showTab(2); > > > > ...to go through this script... > > > function thisMovie(movieName) { > if (navigator.appName.indexOf("Microsoft") != -1) { > return HTMLCollection.namedItem(movieName) > } else { > return document[movieName] > } > } > > > > ...to function on this object... > > > > > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"; > width="670" height="550"> > > > > > > > > quality="high" bgcolor="white" width="670" height="550" > id="studio_loader_embed" > align="middle" allowScriptAccess="sameDomain" > allowFullScreen="false" type="application/x-shockwave-flash" > pluginspage="http://www.macromedia.com/go/getflashplayer"; /> > > > > > > - > > For the thisMovie() function I have tried all these combinations for IE: > > HTMLCollection.namedItem(movieName) // HTMLCollection is undefined > namedItem(movieName) // Object expected > document.getElementById // 'parent.thisMovie(...)' is null or not an object > > > > You can see this functionality work in FF by going here... > > http://www.silverscreendesign.com/designlab.cfm?proid=1264 > > ... and clicking on the "Your Cart" button in the right. Clicking that > button should make the flash movie's tab go to "Add Art" > > It does not work in IE. > > Someone told me that IE cannot talk to an embed tag, only an object tag, but > I believe the ID vs NAME issue is tripping me up. > > I would be more than happy to send a PayPal payment for your time. > > Thanks, > > Mik > > > > > Michael Muller > office (413) 863-6455 > cell (413) 320-5336 > skype: michaelBmuller > http://MontagueWebWorks.com > > Information is not knowledge > Knowlege is not wisdom > > Eschew Obfuscation > > > ~| 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:324386 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
(ot) Javascript Help
Ok, I need some Javascript help. I just cannot get this script (residing in an iframe)... parent.thisMovie('studio_loader_embed').reloadClipart(); parent.thisMovie('studio_loader_embed').showTab(2); ...to go through this script... function thisMovie(movieName) { if (navigator.appName.indexOf("Microsoft") != -1) { return HTMLCollection.namedItem(movieName) } else { return document[movieName] } } ...to function on this object... http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"; width="670" height="550"> http://www.macromedia.com/go/getflashplayer"; /> - For the thisMovie() function I have tried all these combinations for IE: HTMLCollection.namedItem(movieName) // HTMLCollection is undefined namedItem(movieName) // Object expected document.getElementById // 'parent.thisMovie(...)' is null or not an object You can see this functionality work in FF by going here... http://www.silverscreendesign.com/designlab.cfm?proid=1264 ... and clicking on the "Your Cart" button in the right. Clicking that button should make the flash movie's tab go to "Add Art" It does not work in IE. Someone told me that IE cannot talk to an embed tag, only an object tag, but I believe the ID vs NAME issue is tripping me up. I would be more than happy to send a PayPal payment for your time. Thanks, Mik Michael Muller office (413) 863-6455 cell (413) 320-5336 skype: michaelBmuller http://MontagueWebWorks.com Information is not knowledge Knowlege is not wisdom Eschew Obfuscation ~| 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:324381 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: (ot) javascript help
Ah... that makes sense. Thanks everyone for the help! > -Original Message- > From: Greg Morphis [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 11, 2008 1:39 PM > To: CF-Talk > Subject: Re: (ot) javascript help > > because isn't an element of ? > try removing the tabbedTicket or use getElementById > > On Wed, Jun 11, 2008 at 12:34 PM, Chad Gray <[EMAIL PROTECTED]> wrote: > > Can any javascript gurus tell me why this does not work? I want the > tag to display on the page so I get a carriage return between the two > pieces of text "Foo" and "Moo". I get this error in Firbug: > > document.tabbedTicket.FTDTYPEe has no properties > > > > > > > > function makeNewEntry() { > > document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; > > document.tabbedTicket.FTDTYPEe.style.display = ''; > > } > > > > > > name="tabbedTicket"> > > > > > > Foo > > > > Moo > > > > > > > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307265 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: (ot) javascript help
Quite a few issues there... First off, you can generally use one or the other of "visibility" or "display" properties. In your case you'd probably want to use "display" since this will actually create or destroy the space that the br occupies. Then, in makeNewEntry you'd want this one line: document.getElementById('FTDTYPEe').style.display = 'block'; // since it is an id, you can reference it directly, independent of the form Finally, you can remove the visibility property from the br: That should get you where you need to be. -- Josh - Original Message - From: "Chad Gray" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Wednesday, June 11, 2008 10:34 AM Subject: (ot) javascript help > Can any javascript gurus tell me why this does not work? I want the > tag to display on the page so I get a carriage return between the two > pieces of text "Foo" and "Moo". I get this error in Firbug: > document.tabbedTicket.FTDTYPEe has no properties > > > > function makeNewEntry() { > document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; > document.tabbedTicket.FTDTYPEe.style.display = ''; > } > > > name="tabbedTicket"> > > > Foo > > Moo > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307262 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: (ot) javascript help
There's an easier way to do this... Rather than using a br and assigning an id to it, use a div. Divs have built in properties that aren't included in br tags. -Original Message- From: Chad Gray [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2008 12:34 PM To: CF-Talk Subject: (ot) javascript help Can any javascript gurus tell me why this does not work? I want the tag to display on the page so I get a carriage return between the two pieces of text "Foo" and "Moo". I get this error in Firbug: document.tabbedTicket.FTDTYPEe has no properties function makeNewEntry() { document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; document.tabbedTicket.FTDTYPEe.style.display = ''; } Foo Moo ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307260 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: (ot) javascript help
I may be way off-base, but do you need that trailing "e" in "FTDTYPEe"? Could it be the missing "e" from "Firbug"? m!ke On Wed, Jun 11, 2008 at 10:34 AM, Chad Gray <[EMAIL PROTECTED]> wrote: > Can any javascript gurus tell me why this does not work? I want the tag to display on the page so I get a carriage return between the two pieces of text "Foo" and "Moo". I get this error in Firbug: > document.tabbedTicket.FTDTYPEe has no properties ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307259 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: (ot) javascript help
because isn't an element of ? try removing the tabbedTicket or use getElementById On Wed, Jun 11, 2008 at 12:34 PM, Chad Gray <[EMAIL PROTECTED]> wrote: > Can any javascript gurus tell me why this does not work? I want the tag > to display on the page so I get a carriage return between the two pieces of > text "Foo" and "Moo". I get this error in Firbug: > document.tabbedTicket.FTDTYPEe has no properties > > > > function makeNewEntry() { > document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; > document.tabbedTicket.FTDTYPEe.style.display = ''; > } > > > name="tabbedTicket"> > > > Foo > > Moo > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307258 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: (ot) javascript help
try document.getElementById("FTDTYPEe"). And then go get some library that will take care of all that for you (jQuery, Prototype, etc.). cheers, barneyb On Wed, Jun 11, 2008 at 10:34 AM, Chad Gray <[EMAIL PROTECTED]> wrote: > Can any javascript gurus tell me why this does not work? I want the tag > to display on the page so I get a carriage return between the two pieces of > text "Foo" and "Moo". I get this error in Firbug: > document.tabbedTicket.FTDTYPEe has no properties > > > > function makeNewEntry() { > document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; > document.tabbedTicket.FTDTYPEe.style.display = ''; > } > > > name="tabbedTicket"> > > > Foo > > Moo > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307257 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
(ot) javascript help
Can any javascript gurus tell me why this does not work? I want the tag to display on the page so I get a carriage return between the two pieces of text "Foo" and "Moo". I get this error in Firbug: document.tabbedTicket.FTDTYPEe has no properties function makeNewEntry() { document.tabbedTicket.FTDTYPEe.style.visibility = 'visible'; document.tabbedTicket.FTDTYPEe.style.display = ''; } Foo Moo ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:307256 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: javascript help
this works in Firefox on XP. not tested beyond that: for (var i=0; iwrote: > I am taking a page and sending it to CFDocument for a PDF. > > Is there a way to kill all hyper links on the page so there are no hyperlinks > in the PDF? > > Thanks, > Chad > > > ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289746 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript help
Chad Gray wrote: > I am taking a page and sending it to CFDocument for a PDF. > > Is there a way to kill all hyper links on the page so there are no hyperlinks > in the PDF? > Why is this a Javascript question? Just do some regex fun on your output content, stripping all anchor tags, before writing it out to a PDF. ~| Download the latest ColdFusion 8 utilities including Report Builder, plug-ins for Eclipse and Dreamweaver updates. http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289745 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
javascript help
I am taking a page and sending it to CFDocument for a PDF. Is there a way to kill all hyper links on the page so there are no hyperlinks in the PDF? Thanks, Chad ~| Check out the new features and enhancements in the latest product release - download the "What's New PDF" now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:289741 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript help
On Tuesday 29 May 2007, Andy Matthews wrote: > I believe that you have to reference the frame as an array index, similar > to the way you can reference form elements. Get firefox. Get the firebug extension. Set a break point and poke around the DOM :-) -- Tom Chiverton Helping to confidentially differentiate visionary models on: http://thefalken.livejournal.com This email is sent for and on behalf of Halliwells LLP. Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at St James's Court Brown Street Manchester M2 2JF. A list of members is available for inspection at the registered office. Any reference to a partner in relation to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law Society. CONFIDENTIALITY This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 8008. For more information about Halliwells LLP visit www.halliwells.com. ~| 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:279463 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: javascript help
I believe that you have to reference the frame as an array index, similar to the way you can reference form elements. -Original Message- From: Dan Munez [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 29, 2007 9:12 AM To: CF-Talk Subject: OT: javascript help hey guys i have a little window with a link on it opened up a popup window and gave it a name. the new window also has frames in it. I would like to manipulate the forms in that frame, like giving it certain values and stuff, by calling it from the little window. how do I do that? so far i am calling it as window.NEWWINDOWNAME.FRAMENAME.document.formname.inputformname.value but it gives me an object undefined error. help please! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279456 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: javascript help
> hey guys i have a little window with a link on it opened up a popup > window and gave it a name. the new window also has frames in it. I > would like to manipulate the forms in that frame, like giving it > certain values and stuff, by calling it from the little window. how > do I do that? so far i am calling it as window.NEWWINDOWNAME. > FRAMENAME.document.formname.inputformname.value but it gives me an > object undefined error. help please! This is a CF Forum, not a JS forum, but here goes. When you launch the window, you must keep the launched window in a local var. Once you do that, you can access its frameset, etc... Below is an example of what I mean. var newWin; function openTheWindow() { newWin = window.open("launched.html","newWindowName"); } function accessWindow() { alert(newWin.window.frames); } ~| 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:279455 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
OT: javascript help
hey guys i have a little window with a link on it opened up a popup window and gave it a name. the new window also has frames in it. I would like to manipulate the forms in that frame, like giving it certain values and stuff, by calling it from the little window. how do I do that? so far i am calling it as window.NEWWINDOWNAME.FRAMENAME.document.formname.inputformname.value but it gives me an object undefined error. help please! ~| 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:279454 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
And here I was thinking you had no sense of humor ;-) -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Friday, December 22, 2006 10:43 AM To: CF-Talk Subject: RE: Javascript help > Well since we are being smart asses... the question was "how > can I clear either one when I click on any one of the radio buttons." One person's smart ass is another's stickler for accuracy. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264912 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
> Well since we are being smart asses... the question was "how > can I clear either one when I click on any one of the radio buttons." One person's smart ass is another's stickler for accuracy. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264909 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
Well since we are being smart asses... the question was "how can I clear either one when I click on any one of the radio buttons." -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Thursday, December 21, 2006 7:34 PM To: CF-Talk Subject: RE: Javascript help > I don't consider Netscape 2 (or IE pre 5) when I use the > phrase 'cross browser compatible'. Especially when dealing > with JS and/or CSS. I thought the question was, "what is the most compatible way to address a form in JS", not "what browsers do you prefer to disregard?" Right now, the answer to that question is to use the forms array. In XHTML 1.0, the FORM element should not even have a NAME attribute! (It's been deprecated.) http://www.w3.org/TR/xhtml1/#h-4.10 However, the HTML DOM still supports the forms array, and will do so for the foreseeable future: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-1689064 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264865 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
> I don't consider Netscape 2 (or IE pre 5) when I use the > phrase 'cross browser compatible'. Especially when dealing > with JS and/or CSS. I thought the question was, "what is the most compatible way to address a form in JS", not "what browsers do you prefer to disregard?" Right now, the answer to that question is to use the forms array. In XHTML 1.0, the FORM element should not even have a NAME attribute! (It's been deprecated.) http://www.w3.org/TR/xhtml1/#h-4.10 However, the HTML DOM still supports the forms array, and will do so for the foreseeable future: http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-1689064 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264853 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
> > This seems to work, but will it work in all browser? > > > > onFocus="document.updClassified.asking1.value = > > '',document.updClassified.asking2.value = ''" > > > No it won't. > > For that you'll need a function and you'll need to write a > javascript browser diction script and have separate clauses > in the function for each browser. > > Mainly you'll use document.all and document.getElementById() The original code would work fine, as long as the two statements are separated by semicolons, not commas. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264844 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
> You can stack arguments that way, but will calling the field > that way work cross browser? Yes, there's nothing wrong with having multiple statements within an event handler, other than readability. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264843 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Javascript help
so I asked said, "You use WHAT browser?" I dont consider Netscape 2 (or IE pre 5) when I use the phrase 'cross browser compatible'. Especially when dealing with JS and/or CSS. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: Thursday, December 21, 2006 5:42 PM To: CF-Talk Subject: RE: Javascript help > > document.formname.fieldname.value is about as standard as it > > gets AFAIK. > > Yes, it is as vanilla as it gets and easiest for most people > to read and understand. But if you'd like to make it NOT work > in all browsers that can read JS you can try some of these lol > > document.forms[0].myfield.value > document.forms[0]['myfield'].value > document.forms['myform'].myfield.value > document.forms['myform']['myfield'] .value Actually, the first one in Bobby's list (document.forms[0].myfield.value) is the most compatible; it works in Netscape 2, while document.formname.myfield.value will not, if I recall correctly. Support for addressing forms (and elements) using array notation was introduced with the first version of JavaScript. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264842 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Javascript help
> > document.formname.fieldname.value is about as standard as it > > gets AFAIK. > > Yes, it is as vanilla as it gets and easiest for most people > to read and understand. But if you'd like to make it NOT work > in all browsers that can read JS you can try some of these lol > > document.forms[0].myfield.value > document.forms[0]['myfield'].value > document.forms['myform'].myfield.value > document.forms['myform']['myfield'] .value Actually, the first one in Bobby's list (document.forms[0].myfield.value) is the most compatible; it works in Netscape 2, while document.formname.myfield.value will not, if I recall correctly. Support for addressing forms (and elements) using array notation was introduced with the first version of JavaScript. 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! ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264839 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
Yes, it is as vanilla as it gets and easiest for most people to read and understand. But if you'd like to make it NOT work in all browsers that can read JS you can try some of these lol document.forms[0].myfield.value document.forms[0]['myfield'].value document.forms['myform'].myfield.value document.forms['myform']['myfield'] .value -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED] Sent: Thursday, December 21, 2006 4:23 PM To: CF-Talk Subject: Re: Javascript help i'm pretty sure it'll work. but of course i say that and invariably someone comes along and proves that it won't :) seriously tho. document.formname.fieldname.value is about as standard as it gets AFAIK. On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > You can stack arguments that way, but will calling the field that way work > cross browser? > > I don't know, I still write it using different techniques. > > > -Original Message- > > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 21, 2006 4:09 PM > > To: CF-Talk > > Subject: Re: Javascript help > > > > That should work cross-browser, no? it's pretty standard JS syntax. > > > > onfocus="statement1; statement2; statement3..." > > > > as long as each is separated by a semi-colon it should be ok? > > > > On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > > > No it won't. > > > > > > For that you'll need a function and you'll need to write a javascript > > > browser diction script and have separate clauses in the function for > > each > > > browser. > > > > > > Mainly you'll use document.all and document.getElementById() > > > > > > > -Original Message- > > > > From: Doug Brown [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, December 21, 2006 3:51 PM > > > > To: CF-Talk > > > > Subject: Re: Javascript help > > > > > > > > This seems to work, but will it work in all browser? > > > > > > > > onFocus="document.updClassified.asking1.value = > > > > '',document.updClassified.asking2.value = ''" > > > > > > > > Doug B. > > > > > > > > > > > > > > > > > > > > > > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264831 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Javascript help
Check out jQuery. This sort of thing would be a snap in jQuery (http://jQuery.com). Doug Brown wrote: > I have a form with 2 text fields and some radio button, and what I would like > to do is clear any text in the text fields if any of the radio buttons are > selected. I can do this with one text field, but not sure how to work it with > two > > This will work with one text field... > > ClassAdDetails.quantity_option eq > "quantity">value="#ClassAdDetails.AQuantity#"> > > onFocus="document.updClassified.Aquantity.value = ''"> > > > > But.Say just one of these text fields have a value, how can I clear > either one when I click on any one of the radio buttons. > > > > > > onFocus="?"> > onFocus="?"> > onFocus="?"> > > > Doug B. > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264825 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Javascript help
i'm pretty sure it'll work. but of course i say that and invariably someone comes along and proves that it won't :) seriously tho. document.formname.fieldname.value is about as standard as it gets AFAIK. On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > You can stack arguments that way, but will calling the field that way work > cross browser? > > I don't know, I still write it using different techniques. > > > -Original Message- > > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 21, 2006 4:09 PM > > To: CF-Talk > > Subject: Re: Javascript help > > > > That should work cross-browser, no? it's pretty standard JS syntax. > > > > onfocus="statement1; statement2; statement3..." > > > > as long as each is separated by a semi-colon it should be ok? > > > > On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > > > No it won't. > > > > > > For that you'll need a function and you'll need to write a javascript > > > browser diction script and have separate clauses in the function for > > each > > > browser. > > > > > > Mainly you'll use document.all and document.getElementById() > > > > > > > -Original Message- > > > > From: Doug Brown [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, December 21, 2006 3:51 PM > > > > To: CF-Talk > > > > Subject: Re: Javascript help > > > > > > > > This seems to work, but will it work in all browser? > > > > > > > > onFocus="document.updClassified.asking1.value = > > > > '',document.updClassified.asking2.value = ''" > > > > > > > > Doug B. > > > > > > > > > > > > > > > > > > > > > > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264824 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
Also your using a comma and not a semi colon, sorry forgot to add that. > -Original Message- > From: loathe [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 21, 2006 4:07 PM > To: CF-Talk > Subject: RE: Javascript help > > No it won't. > > For that you'll need a function and you'll need to write a javascript > browser diction script and have separate clauses in the function for each > browser. > > Mainly you'll use document.all and document.getElementById() > > > -Original Message- > > From: Doug Brown [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 21, 2006 3:51 PM > > To: CF-Talk > > Subject: Re: Javascript help > > > > This seems to work, but will it work in all browser? > > > > onFocus="document.updClassified.asking1.value = > > '',document.updClassified.asking2.value = ''" > > > > Doug B. > > > > > > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264823 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Javascript help
You can stack arguments that way, but will calling the field that way work cross browser? I don't know, I still write it using different techniques. > -Original Message- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 21, 2006 4:09 PM > To: CF-Talk > Subject: Re: Javascript help > > That should work cross-browser, no? it's pretty standard JS syntax. > > onfocus="statement1; statement2; statement3..." > > as long as each is separated by a semi-colon it should be ok? > > On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > > No it won't. > > > > For that you'll need a function and you'll need to write a javascript > > browser diction script and have separate clauses in the function for > each > > browser. > > > > Mainly you'll use document.all and document.getElementById() > > > > > -Original Message- > > > From: Doug Brown [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, December 21, 2006 3:51 PM > > > To: CF-Talk > > > Subject: Re: Javascript help > > > > > > This seems to work, but will it work in all browser? > > > > > > onFocus="document.updClassified.asking1.value = > > > '',document.updClassified.asking2.value = ''" > > > > > > Doug B. > > > > > > > > > > > > > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264822 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Javascript help
That should work cross-browser, no? it's pretty standard JS syntax. onfocus="statement1; statement2; statement3..." as long as each is separated by a semi-colon it should be ok? On 12/21/06, loathe <[EMAIL PROTECTED]> wrote: > No it won't. > > For that you'll need a function and you'll need to write a javascript > browser diction script and have separate clauses in the function for each > browser. > > Mainly you'll use document.all and document.getElementById() > > > -Original Message- > > From: Doug Brown [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 21, 2006 3:51 PM > > To: CF-Talk > > Subject: Re: Javascript help > > > > This seems to work, but will it work in all browser? > > > > onFocus="document.updClassified.asking1.value = > > '',document.updClassified.asking2.value = ''" > > > > Doug B. > > > > > > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264818 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
No it won't. For that you'll need a function and you'll need to write a javascript browser diction script and have separate clauses in the function for each browser. Mainly you'll use document.all and document.getElementById() > -Original Message- > From: Doug Brown [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 21, 2006 3:51 PM > To: CF-Talk > Subject: Re: Javascript help > > This seems to work, but will it work in all browser? > > onFocus="document.updClassified.asking1.value = > '',document.updClassified.asking2.value = ''" > > Doug B. > > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264814 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Javascript help
1. Don't use on focus, use on click. Users (well power users) and the disabled tab through form fields, and if you do on focus it will empty to form field even if they don't want to. 2. When dealing with multiple fields I would recommend your using a function in a script block kicked off by the onchange event. Example: JS Test function clearForm(){ document.myForm.myField1.value=""; document.myForm.myField2.value=""; } Also a couple of other tips. 1. Try and use XHTML. All attributes and tags need to be lower cased. 2. Only use pound signs when they are needed, same with parens. 3. DO NOT use camel case inside a tag unless your referencing a variable, everything else should be in lowers. 4. If you decide you don't want to create a function to handle this you can string statements together in the event handler using the semi-colon ; Example: One thing to be aware of with this is that you need to use different quotes, one for CF/HTML and one for JS. See you're declaring a string inside where your telling the object what event handler to run, or in this case writing the event handler on the tag. I use double quotes in tags, and singles in JS, it's a bit more difficult when you're creating dynamic SQL as you have to use the single quote. Anyway, hope it helps. > -Original Message- > From: Doug Brown [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 21, 2006 3:34 PM > To: CF-Talk > Subject: Javascript help > > I have a form with 2 text fields and some radio button, and what I would > like to do is clear any text in the text fields if any of the radio > buttons are selected. I can do this with one text field, but not sure how > to work it with two > > This will work with one text field... > > ClassAdDetails.quantity_option eq > "quantity">value="#ClassAdDetails.AQuantity#"> > > onFocus="document.updClassified.Aquantity.value = ''"> > > > > But.Say just one of these text fields have a value, how can I clear > either one when I click on any one of the radio buttons. > > > > > > onFocus="?"> > onFocus="?"> > onFocus="?"> > > > Doug B. > > ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264811 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Javascript help
This seems to work, but will it work in all browser? onFocus="document.updClassified.asking1.value = '',document.updClassified.asking2.value = ''" Doug B. ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264808 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Javascript help
On the radio button... Onclick="document.myform.mytextfield.value='';" If you are saying you want to clear both text fields Onclick="document.myform.mytextfield.value=''; document.myform.myothertextfield.value='';" -Original Message- From: Doug Brown [mailto:[EMAIL PROTECTED] Sent: Thursday, December 21, 2006 3:34 PM To: CF-Talk Subject: Javascript help I have a form with 2 text fields and some radio button, and what I would like to do is clear any text in the text fields if any of the radio buttons are selected. I can do this with one text field, but not sure how to work it with two This will work with one text field... value="#ClassAdDetails.AQuantity#"> But.Say just one of these text fields have a value, how can I clear either one when I click on any one of the radio buttons. Doug B. ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264806 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Javascript help
I have a form with 2 text fields and some radio button, and what I would like to do is clear any text in the text fields if any of the radio buttons are selected. I can do this with one text field, but not sure how to work it with two This will work with one text field... value="#ClassAdDetails.AQuantity#"> But.Say just one of these text fields have a value, how can I clear either one when I click on any one of the radio buttons. Doug B. ~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264805 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: OT: Javascript help
TanGuy, Thanks, I think that first link helped a lot. I see what the guy is saying (and I forgot that var's all get moved up to the highest scope - its sad that I used to aide a web-dev class). So now, I have something that works in terms of passing around variables that make sense: Javascript Dynamic Variables function TestClass( strName ){ this.Name = strName; } TestClass.prototype.AlertValue = function( anyValue ){ alert( this.Name + " is alerting: " + anyValue ); } function Init(){ var objContentDiv = document.getElementById( "content" ); var objA = null; var objTest = new TestClass( "Tester" ); // This runs the for loop using a LOCAL scope for each iteration. (function loop( intI ){ var intX = intI; if (intI < 10){ // Create new A element. objA = document.createElement( "a" ); // Set A display properties. objA.style.display = "block"; objA.style.backgroundColor = "#F8F8F8"; objA.style.border = "1px solid #33"; objA.style.padding = "10px 10px 10px 10px"; objA.style.color = "#33"; objA.style.marginBottom = "15px"; // Create text for the link. objA.appendChild( document.createTextNode( "I should alert " + intX + " when clicked" ) ); // Set the href. objA.setAttribute( "href", "##" ); // Set the onclick method. objA.onclick = function(){ objTest.AlertValue( intX ) }; // Attach the A to the content. objContentDiv.appendChild( objA ); loop(intI + 1); } })(0); } // Is the tester class available here (just testing). alert( "objTest is of type: " + typeof(objTest)); Thanks for everyone's help. I think I now see the local scoping issue that I was dealing with before. I will try to return with a better example. ... Ben Nadel www.bennadel.com -Original Message- From: Tanguy Rademakers [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 1:19 PM To: CF-Talk Subject: Re: OT: Javascript help Hi Ben, I ran into this problem recently - these really helped me out: http://joust.kano.net/weblog/archive/2005/08/08/a-huge-gotcha-with-javascrip t-closures and http://jibbering.com/faq/faq_notes/closures.html /t ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238316 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: OT: Javascript help
Cutter, I like this suggestion: >> objA.currentI = intI; >> objA.onclick = function(){ alert( this.currentI ); }; This is actually how I deal with this same problem in Flash Action Script sometimes. However, in Flash I do it on objects, and in JS it always makes me nervous to try adding data to an object that doesn't inherently have that attribute. ... Ben Nadel www.bennadel.com -Original Message- From: Cutter (CFRelated) [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 1:00 PM To: CF-Talk Subject: Re: OT: Javascript help Asking your question of my javascipt list, the responses were as follows: Repsonse 1 Have you tried this? objA.onclick = new Function ("alert(" + intI + ")" ); Response 2 >for (var intI = 0 ; intI < 10 ; intI++){ >> var objA = document.createElement( "div" ); Place one "var objA;" before the loop then remove the "var" inside. Redeclaring a variable is a bad practice that will bite you in other languages. >> objA.onclick = function(){ alert( intI ); }; It's doing its job, it's alerting the value of intI, which is what you left it. The easiest solution is to add a custom property to the object to hold the current value of intI: objA.currentI = intI; objA.onclick = function(){ alert( this.currentI ); }; Response 3 >objA.onclick = new Function ("alert(" + intI + ")" ); This should work, but from what I understand new Function (like eval) must be compiled on the spot, so there's a (however slight) performance hit. http://userjs.org/help/tutorials/efficient-code Hope some of this helps Cutter Ben Nadel wrote: > Not really for CF, but though someone here could lend some insight > > There is one problem in Javascript that I cannot seem to get a handle > on and it is killling me! I can't seem to get variables to pass by > value as I would hope. Take the following example: > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = > document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = function(){ alert( intI ); }; > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > Now, in my head, each one of those links, when clicked should alert > the appropriate intI value (0, 1, 2, 3, etc.); however, each of them > will alert 10 which is the value that broke the FOR loop. It's like > they all point to one variable and then get updated for each loop of the FOR iteration. > > I can't seem to find a good solution to this. One method that seems to > work, but is poop is something along the lines of: > > // Define a function INSIDE this function. > function GetI( intX ){ > return( > function(){ alert(intX); }; > ); > } > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = > document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = GetI( intX ); > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > This method works as would be expected, though I seem to think that it > is doing the exact same thing. It must be something to do with the scoping. > Since the intI value is getting passed to a local scope (int GetI()), > and then getting passed back, it must be unique (since the local scope > of the > GetI() method is created unique of each FOR iteration. > > This solution seems truly ganky to me. There has to be a better way. > And this is just a simple example. I have many places where I want to > be doing this with object reference and dynamic event handling. This > one simple bumb is really holding me back! > > Please help!!! > ... > Ben Nadel > www.bennadel.com > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238315 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: OT: Javascript help
Hi Ben, I ran into this problem recently - these really helped me out: http://joust.kano.net/weblog/archive/2005/08/08/a-huge-gotcha-with-javascript-closures and http://jibbering.com/faq/faq_notes/closures.html /t ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238312 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: Javascript help
Gotcha, I just saw a couple other posts that got separated into another thread that explained that. I'll try it again in a few. ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 11:01 AM To: CF-Talk Subject: RE: Javascript help Bobby, I cannot seem to get the onCLick to fire in my browser. Granted I am using IE in Homesite. But, my concern with this solution is that I feel (without testing) that it is string dependent. divCont.setAttribute('onClick', 'alert(' + IntI + ')'); That line is going to try to force intI to a string, which works for simple values, but will not work with complex values. Ben Nadel www.bennadel.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:49 AM To: CF-Talk Subject: RE: Javascript help Is this what you were going for? for (IntI = 0; IntI < 10; IntI++) { divCont = document.createElement('DIV'); divCont.id = 'div' + IntI; divCont.appendChild(document.createElement('BR')); divCont.style.background='ececec'; divCont.style.borderColor = '00'; divCont.style.borderStyle = 'solid'; divCont.style.borderWidth = '1px'; divCont.setAttribute('onClick', 'alert(' + IntI + ')'); document.getElementById('mainContainer').appendChild(divCont); document.getElementById('mainContainer').appendChild(document.createElement( 'BR')); } The onclick of the divs wont work in IE 6- :.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! .. Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238311 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: OT: Javascript help
Asking your question of my javascipt list, the responses were as follows: Repsonse 1 Have you tried this? objA.onclick = new Function ("alert(" + intI + ")" ); Response 2 >for (var intI = 0 ; intI < 10 ; intI++){ >> var objA = document.createElement( "div" ); Place one "var objA;" before the loop then remove the "var" inside. Redeclaring a variable is a bad practice that will bite you in other languages. >> objA.onclick = function(){ alert( intI ); }; It's doing its job, it's alerting the value of intI, which is what you left it. The easiest solution is to add a custom property to the object to hold the current value of intI: objA.currentI = intI; objA.onclick = function(){ alert( this.currentI ); }; Response 3 >objA.onclick = new Function ("alert(" + intI + ")" ); This should work, but from what I understand new Function (like eval) must be compiled on the spot, so there's a (however slight) performance hit. http://userjs.org/help/tutorials/efficient-code Hope some of this helps Cutter Ben Nadel wrote: > Not really for CF, but though someone here could lend some insight > > There is one problem in Javascript that I cannot seem to get a handle on and > it is killling me! I can't seem to get variables to pass by value as I would > hope. Take the following example: > > for (var intI = 0 ; intI < 10 ; intI++){ > var objA = document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = function(){ alert( intI ); }; > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > Now, in my head, each one of those links, when clicked should alert the > appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert > 10 which is the value that broke the FOR loop. It's like they all point to > one variable and then get updated for each loop of the FOR iteration. > > I can't seem to find a good solution to this. One method that seems to work, > but is poop is something along the lines of: > > // Define a function INSIDE this function. > function GetI( intX ){ > return( > function(){ alert(intX); }; > ); > } > > for (var intI = 0 ; intI < 10 ; intI++){ > var objA = document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = GetI( intX ); > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > This method works as would be expected, though I seem to think that it is > doing the exact same thing. It must be something to do with the scoping. > Since the intI value is getting passed to a local scope (int GetI()), and > then getting passed back, it must be unique (since the local scope of the > GetI() method is created unique of each FOR iteration. > > This solution seems truly ganky to me. There has to be a better way. And > this is just a simple example. I have many places where I want to be doing > this with object reference and dynamic event handling. This one simple bumb > is really holding me back! > > Please help!!! > ... > Ben Nadel > www.bennadel.com > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238310 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: Javascript help
Bobby, I cannot seem to get the onCLick to fire in my browser. Granted I am using IE in Homesite. But, my concern with this solution is that I feel (without testing) that it is string dependent. divCont.setAttribute('onClick', 'alert(' + IntI + ')'); That line is going to try to force intI to a string, which works for simple values, but will not work with complex values. ... Ben Nadel www.bennadel.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:49 AM To: CF-Talk Subject: RE: Javascript help Is this what you were going for? for (IntI = 0; IntI < 10; IntI++) { divCont = document.createElement('DIV'); divCont.id = 'div' + IntI; divCont.appendChild(document.createElement('BR')); divCont.style.background='ececec'; divCont.style.borderColor = '00'; divCont.style.borderStyle = 'solid'; divCont.style.borderWidth = '1px'; divCont.setAttribute('onClick', 'alert(' + IntI + ')'); document.getElementById('mainContainer').appendChild(divCont); document.getElementById('mainContainer').appendChild(document.createElement( 'BR')); } The onclick of the divs wont work in IE 6- ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! . Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238292 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: Javascript help
PS... in your original code > It's like they all point to > one variable and then get > updated for each loop of the FOR iteration They do. Each of your onclicks triggered the same function that alerted the same variable. The last time the variable was set, it was 10. So they are all 10. ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238290 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: Javascript help
Is this what you were going for? for (IntI = 0; IntI < 10; IntI++) { divCont = document.createElement('DIV'); divCont.id = 'div' + IntI; divCont.appendChild(document.createElement('BR')); divCont.style.background='ececec'; divCont.style.borderColor = '00'; divCont.style.borderStyle = 'solid'; divCont.style.borderWidth = '1px'; divCont.setAttribute('onClick', 'alert(' + IntI + ')'); document.getElementById('mainContainer').appendChild(divCont); document.getElementById('mainContainer').appendChild(document.createElement( 'BR')); } The onclick of the divs wont work in IE 6- ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238289 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: OT: Javascript help
Zaphod, I think that solution works for strings/numbers, but I would also like this to work with object refrences ... Something like: objMenu.onmouseover = function(){ objMenuSystem.Show(this); } The problem here is the same... When the mouse over fires, "objMenuSystem" is no undefined since it tries to find it reference to the Menu, not the varaible reference. But then again, if I wanted it to work my way, "this" would be off too, since it would point to the housing method... Not the objMenu... Hmmm .. .and ... Dangy! ... Ben Nadel www.bennadel.com -Original Message- From: Zaphod Beeblebrox [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:31 AM To: CF-Talk Subject: Re: OT: Javascript help the most I can think of is to evaluate the value right at the function declaration: objA.onclick = eval ('function(){ alert( ' + intI + ' ); };'); On 4/20/06, Ben Nadel <[EMAIL PROTECTED]> wrote: > > Not really for CF, but though someone here could lend some insight > > There is one problem in Javascript that I cannot seem to get a handle > on and it is killling me! I can't seem to get variables to pass by > value as I would hope. Take the following example: > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = > document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = function(){ alert( intI ); }; > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > Now, in my head, each one of those links, when clicked should alert > the appropriate intI value (0, 1, 2, 3, etc.); however, each of them > will alert 10 which is the value that broke the FOR loop. It's like > they all point to one variable and then get updated for each loop of > the FOR iteration. > > I can't seem to find a good solution to this. One method that seems to > work, but is poop is something along the lines of: > > // Define a function INSIDE this function. > function GetI( intX ){ > return( > function(){ alert(intX); }; > ); > } > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = > document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = GetI( intX ); > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > This method works as would be expected, though I seem to think that it > is doing the exact same thing. It must be something to do with the scoping. > Since the intI value is getting passed to a local scope (int GetI()), > and then getting passed back, it must be unique (since the local scope > of the > GetI() method is created unique of each FOR iteration. > > This solution seems truly ganky to me. There has to be a better way. > And this is just a simple example. I have many places where I want to > be doing this with object reference and dynamic event handling. This > one simple bumb is really holding me back! > > Please help!!! > ... > Ben Nadel > www.bennadel.com > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238288 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: OT: Javascript help
the most I can think of is to evaluate the value right at the function declaration: objA.onclick = eval ('function(){ alert( ' + intI + ' ); };'); On 4/20/06, Ben Nadel <[EMAIL PROTECTED]> wrote: > > Not really for CF, but though someone here could lend some insight > > There is one problem in Javascript that I cannot seem to get a handle on > and > it is killling me! I can't seem to get variables to pass by value as I > would > hope. Take the following example: > > for (var intI = 0 ; intI < 10 ; intI++){ > var objA = document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = function(){ alert( intI ); }; > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > Now, in my head, each one of those links, when clicked should alert the > appropriate intI value (0, 1, 2, 3, etc.); however, each of them will > alert > 10 which is the value that broke the FOR loop. It's like they all point to > one variable and then get updated for each loop of the FOR iteration. > > I can't seem to find a good solution to this. One method that seems to > work, > but is poop is something along the lines of: > > // Define a function INSIDE this function. > function GetI( intX ){ > return( > function(){ alert(intX); }; > ); > } > > for (var intI = 0 ; intI < 10 ; intI++){ > var objA = document.createElement( "div" ); > > // Set the click for the link. > objA.onclick = GetI( intX ); > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > This method works as would be expected, though I seem to think that it is > doing the exact same thing. It must be something to do with the scoping. > Since the intI value is getting passed to a local scope (int GetI()), and > then getting passed back, it must be unique (since the local scope of the > GetI() method is created unique of each FOR iteration. > > This solution seems truly ganky to me. There has to be a better way. And > this is just a simple example. I have many places where I want to be doing > this with object reference and dynamic event handling. This one simple > bumb > is really holding me back! > > Please help!!! > ... > Ben Nadel > www.bennadel.com > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238286 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: Javascript help
The loop is fine. It's difficult to see the braces in the text, but they're correct. Maybe you can't pass objects by value? You would think that, if it were possible, using the var keyword would ensure a new variable. On 4/20/06, Ben Nadel <[EMAIL PROTECTED]> wrote: > Bobby, > > I don't think they are, it might just parse weird for CFTalk... However, > this is just sample code that I wrote in the email, so it might not be 100% > accurate. But, in real test cases, when I do put the onclick I nthe FOR > loop, they still all alert the same number. > > ... > Ben Nadel > www.bennadel.com > > -Original Message- > From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 20, 2006 10:06 AM > To: CF-Talk > Subject: RE: Javascript help > > The onclicks are outside of the loop > > ...:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > > > > > > -Original Message- > From: Ben Nadel [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 20, 2006 9:35 AM > To: CF-Talk > Subject: OT: Javascript help > > Not really for CF, but though someone here could lend some insight > > There is one problem in Javascript that I cannot seem to get a handle on and > it is killling me! I can't seem to get variables to pass by value as I would > hope. Take the following example: > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( > "div" ); > > // Set the click for the link. > objA.onclick = function(){ alert( intI ); }; > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > Now, in my head, each one of those links, when clicked should alert the > appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert > 10 which is the value that broke the FOR loop. It's like they all point to > one variable and then get updated for each loop of the FOR iteration. > > I can't seem to find a good solution to this. One method that seems to work, > but is poop is something along the lines of: > > // Define a function INSIDE this function. > function GetI( intX ){ > return( > function(){ alert(intX); }; > ); > } > > for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( > "div" ); > > // Set the click for the link. > objA.onclick = GetI( intX ); > > // Set the link into the body div. > objDiv.appendChild( objA ); > } > > This method works as would be expected, though I seem to think that it is > doing the exact same thing. It must be something to do with the scoping. > Since the intI value is getting passed to a local scope (int GetI()), and > then getting passed back, it must be unique (since the local scope of the > GetI() method is created unique of each FOR iteration. > > This solution seems truly ganky to me. There has to be a better way. And > this is just a simple example. I have many places where I want to be doing > this with object reference and dynamic event handling. This one simple bumb > is really holding me back! > > Please help!!! > . > Ben Nadel > www.bennadel.com > > > > > > > ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238278 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: Javascript help
Maybe I'll get caffeine in me before I answer the next one. I'll take a closer look ;-) ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238275 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: Javascript help
Bobby, I don't think they are, it might just parse weird for CFTalk... However, this is just sample code that I wrote in the email, so it might not be 100% accurate. But, in real test cases, when I do put the onclick I nthe FOR loop, they still all alert the same number. ... Ben Nadel www.bennadel.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 10:06 AM To: CF-Talk Subject: RE: Javascript help The onclicks are outside of the loop ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! . Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238274 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: Javascript help
The onclicks are outside of the loop ..:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Ben Nadel [mailto:[EMAIL PROTECTED] Sent: Thursday, April 20, 2006 9:35 AM To: CF-Talk Subject: OT: Javascript help Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238272 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
OT: Javascript help
Not really for CF, but though someone here could lend some insight There is one problem in Javascript that I cannot seem to get a handle on and it is killling me! I can't seem to get variables to pass by value as I would hope. Take the following example: for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = function(){ alert( intI ); }; // Set the link into the body div. objDiv.appendChild( objA ); } Now, in my head, each one of those links, when clicked should alert the appropriate intI value (0, 1, 2, 3, etc.); however, each of them will alert 10 which is the value that broke the FOR loop. It's like they all point to one variable and then get updated for each loop of the FOR iteration. I can't seem to find a good solution to this. One method that seems to work, but is poop is something along the lines of: // Define a function INSIDE this function. function GetI( intX ){ return( function(){ alert(intX); }; ); } for (var intI = 0 ; intI < 10 ; intI++){ var objA = document.createElement( "div" ); // Set the click for the link. objA.onclick = GetI( intX ); // Set the link into the body div. objDiv.appendChild( objA ); } This method works as would be expected, though I seem to think that it is doing the exact same thing. It must be something to do with the scoping. Since the intI value is getting passed to a local scope (int GetI()), and then getting passed back, it must be unique (since the local scope of the GetI() method is created unique of each FOR iteration. This solution seems truly ganky to me. There has to be a better way. And this is just a simple example. I have many places where I want to be doing this with object reference and dynamic event handling. This one simple bumb is really holding me back! Please help!!! ... Ben Nadel www.bennadel.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:238263 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: Javascript help.
Worked like a charm! Thanks much. Jeff On 12/6/05, Bobby Hartsfield <[EMAIL PROTECTED]> wrote: > > This should do it. > > > function selTA() > { > document.myform.myfield.focus(); > document.myform.myfield.selectionStart=0; > document.myform.myfield.selectionEnd=0; > } > > window.onload = selTA; > > > ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > > -Original Message- > From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 06, 2005 2:38 PM > To: CF-Talk > Subject: RE: Javascript help. > > Hmmm guess that only places the cursor at the beginning in IE... gimmee a > minute :) > > ...:.:.:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > -Original Message- > From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 06, 2005 2:31 PM > To: CF-Talk > Subject: RE: Javascript help. > > function selTA() > { > document.formname.fieldname.focus(); > } > > window.onload = selTA; > > > > > :.:.:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > -Original Message- > From: J W [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 06, 2005 2:24 PM > To: CF-Talk > Subject: OT: Javascript help. > > I have been beating my head around for the better part of today trying to > figure this out.. > > I am prefilling a textarea with some information. > > When the page loads, I would like to set focus to the text area and have > the > cursor position set to the first character in the textarea with the > prefilled info. Is this even possible or am I just missing something > stupid. > I have scoured google to no avail... > > Thanks, > Jeff > > > > > > > > > ~| 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:226281 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: Javascript help.
Well thats interesting, I have been testing in Firefox all day. S I fired up the code in IE and noticed a difference. IE. Works just fine. Cusor at Top Firefox. Focus is set, but cursor is set at the end of text. So focus alone doesn't gurantee that the cursor will be at the beginning of the text cross browser. Intersting. Thats why I was wondering if there was a way to specifically set the position. Jeff On 12/6/05, Bobby Hartsfield <[EMAIL PROTECTED]> wrote: > > function selTA() > { > document.formname.fieldname.focus(); > } > > window.onload = selTA; > > > > > ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. > Bobby Hartsfield > http://acoderslife.com > > -Original Message- > From: J W [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 06, 2005 2:24 PM > To: CF-Talk > Subject: OT: Javascript help. > > I have been beating my head around for the better part of today trying to > figure this out.. > > I am prefilling a textarea with some information. > > When the page loads, I would like to set focus to the text area and have > the > cursor position set to the first character in the textarea with the > prefilled info. Is this even possible or am I just missing something > stupid. > I have scoured google to no avail... > > Thanks, > Jeff > > > > > ~| 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:226276 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: Javascript help.
This should do it. function selTA() { document.myform.myfield.focus(); document.myform.myfield.selectionStart=0; document.myform.myfield.selectionEnd=0; } window.onload = selTA; ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:38 PM To: CF-Talk Subject: RE: Javascript help. Hmmm guess that only places the cursor at the beginning in IE... gimmee a minute :) ...:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:31 PM To: CF-Talk Subject: RE: Javascript help. function selTA() { document.formname.fieldname.focus(); } window.onload = selTA; :.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: J W [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:24 PM To: CF-Talk Subject: OT: Javascript help. I have been beating my head around for the better part of today trying to figure this out.. I am prefilling a textarea with some information. When the page loads, I would like to set focus to the text area and have the cursor position set to the first character in the textarea with the prefilled info. Is this even possible or am I just missing something stupid. I have scoured google to no avail... Thanks, Jeff ~| 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:226272 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: Javascript help.
Hmmm guess that only places the cursor at the beginning in IE... gimmee a minute :) ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:31 PM To: CF-Talk Subject: RE: Javascript help. function selTA() { document.formname.fieldname.focus(); } window.onload = selTA; ...:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: J W [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:24 PM To: CF-Talk Subject: OT: Javascript help. I have been beating my head around for the better part of today trying to figure this out.. I am prefilling a textarea with some information. When the page loads, I would like to set focus to the text area and have the cursor position set to the first character in the textarea with the prefilled info. Is this even possible or am I just missing something stupid. I have scoured google to no avail... Thanks, Jeff ~| 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:226268 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: Javascript help.
function selTA() { document.formname.fieldname.focus(); } window.onload = selTA; ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -Original Message- From: J W [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 06, 2005 2:24 PM To: CF-Talk Subject: OT: Javascript help. I have been beating my head around for the better part of today trying to figure this out.. I am prefilling a textarea with some information. When the page loads, I would like to set focus to the text area and have the cursor position set to the first character in the textarea with the prefilled info. Is this even possible or am I just missing something stupid. I have scoured google to no avail... Thanks, Jeff ~| 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:226266 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
OT: Javascript help.
I have been beating my head around for the better part of today trying to figure this out.. I am prefilling a textarea with some information. When the page loads, I would like to set focus to the text area and have the cursor position set to the first character in the textarea with the prefilled info. Is this even possible or am I just missing something stupid. I have scoured google to no avail... Thanks, Jeff ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226261 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: CF/JavaScript help on signup
You can also use the same statement to display a text message on your page incase JS is not on. And to be picky... alert("Invalid Login Message"); Invalid Login Message User logged in. This code ensures that the javascript block is between the tags and will also give you a non-js message to make sure the message is seen by everyone. ..:.:.:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield HYPERLINK "http://acoderslife.com/"http://acoderslife.com -Original Message- From: Charlie Hanlon [mailto:[EMAIL PROTECTED] Sent: Monday, October 24, 2005 5:26 PM To: CF-Talk Subject: Re: CF/JavaScript help on signup alert("In-Valid Login Message"); hth Elena Charlie Hanlon Web Apps Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference - Original Message - From: "Aminova, Elena" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, October 24, 2005 5:20 PM Subject: CF/JavaScript help on signup > Please advise what I can do in Cold Fusion, perhaps using JavaScript? > I have a login page and on it, I need when the user enters wrong > username and/or password which don't match up in the DB, I need to pop > up or display a user friendly message that the entry does not match up, > doesn't matter what the message is. Right now I just do this in the > login processing page: > > (logon is the query that checks the DB if > there are any records with the form inputed username and password) > > > > > PLEASE HELP!!! > > Thanks. > > Elena > > ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:222142 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: CF/JavaScript help on signup
alert("In-Valid Login Message"); hth Elena Charlie Hanlon Web Apps Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference - Original Message - From: "Aminova, Elena" <[EMAIL PROTECTED]> To: "CF-Talk" Sent: Monday, October 24, 2005 5:20 PM Subject: CF/JavaScript help on signup > Please advise what I can do in Cold Fusion, perhaps using JavaScript? > I have a login page and on it, I need when the user enters wrong > username and/or password which don't match up in the DB, I need to pop > up or display a user friendly message that the entry does not match up, > doesn't matter what the message is. Right now I just do this in the > login processing page: > > (logon is the query that checks the DB if > there are any records with the form inputed username and password) > > > > > PLEASE HELP!!! > > Thanks. > > Elena > > ~| 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:222124 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
CF/JavaScript help on signup
Please advise what I can do in Cold Fusion, perhaps using JavaScript? I have a login page and on it, I need when the user enters wrong username and/or password which don't match up in the DB, I need to pop up or display a user friendly message that the entry does not match up, doesn't matter what the message is. Right now I just do this in the login processing page: (logon is the query that checks the DB if there are any records with the form inputed username and password) PLEASE HELP!!! Thanks. Elena ~| 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:222123 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
OT: Need Javascript Help
Hi, I need some advice about javascript. Could someone contact me offline to discuss it? Thanks. PHil ~| Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF community. http://www.houseoffusion.com/banners/view.cfm?bannerid=38 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:183131 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: JAVASCRIPT help
Keep in mind the value property of a select is not supported on all browsers. I usually consider a textbox/textarea empty if there are only spaces (I usually trim the values anyway. Also keep in mind that "title" and "target" are properties of the form. To avoid mixing up formfields and properties, I always have the formfield names in uppercase (JS is case sensitive). Finally, you can set the focus on the field that has an error to help your user fill in the form. Pascal
> -Original Message- > From: Asim Manzur [mailto:[EMAIL PROTECTED] > Sent: maandag 28 juni 2004 22:47 > To: CF-Talk > Subject: Re: _javascript_ help > > Thanks Mike, > > That works great. > > What if the user change the value of the target from "" to > "_self" or "_blank" then I need to display the msg to put the > Link as well. > > thanks [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: JAVASCRIPT help
Thanks Mike, That works great. What if the user change the value of the target from "" to "_self" or "_blank" then I need to display the msg to put the Link as well. thanks [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: JAVASCRIPT help
function checkForm() { var title= document.myForm.title.value; var story= document.myForm.story.value; var link= document.myForm.link.value; var target= document.myForm.target.value; var fbString = ''; if (title == '') fbString = fbString + "You must enter a title\n"; if (story == '') fbString = fbString + "You must enter a story\n"; if (link != '' && target == '') fbString = fbString + "You must enter a target for your link\n"; if (fbString != '') { alert(fbString); return false; } else { return true; } } ...and in your form checkForm();"> -mike Asim Manzur <[EMAIL PROTECTED]> 06/28/2004 03:30 PM Please respond to cf-talk To: CF-Talk <[EMAIL PROTECTED]> cc: Subject:_javascript_ help Can someone give me a hand on _javascript_ validation? I have a form with the following fields title story link target with the value of "_self" "_blank" and "" What I want that "TITLE and STORY should not be empty and if something in the link then target sould not be empty" Will appriciate that Regards, Asim Manzur [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
JAVASCRIPT help
Can someone give me a hand on _javascript_ validation? I have a form with the following fields title story link target with the value of "_self" "_blank" and "" What I want that "TITLE and STORY should not be empty and if something in the link then target sould not be empty" Will appriciate that Regards, Asim Manzur [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
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 JG> "ALL")> JG> Maybe you have a better solution? If CF4 supports replacelist(): mystring="foo to the bar"; lstbad="foo,bar"; lstgood="\foo,\bar"; mystring=replacelist(mystring,lstbad,lstgood); 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]
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 with 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 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]
CF and JavaScript HELP - Maybe OT?
Tough day. Alzheimers is acting up. I have the following _javascript_ code:
c=#currentrow#-1; //599
var nopt = new Option();
nopt.value = "#valuedata#";
nopt.text = "#optiontext#";
parent.frames[0].document.all.individuallist1.options[c] = nopt;
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]
MY BAD! - "RE: JavaScript Help Required"
This is to the _javascript_ problem, "_javascript_ Help Required" Sorry for the accidental thread start [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Javascript Help Required
That must be a mistake writing email however my code works fine. Only problem is that I dont know how to keep the image active (Red One) when a link is active. _ From: MILAN MUSHRAN [mailto:[EMAIL PROTECTED] Sent: 30 December 2003 14:10 To: CF-Talk Subject: RE: _javascript_ Help Required You have a Syntax error... You missed the double quotes on the first image. b1.src = ""> >From: "Shahzad.Butt" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: _javascript_ Help Required >Date: Tue, 30 Dec 2003 11:40:34 - > >Hi > >I am using following script to change the image for a button on >mouseOver (red button) and mouseOut (white button). What I can not >achieve or I dont know how to do is when link is active then display >image which I am using on mouseOver > >
>
> if (browserVer == 1) {
> b1 = new Image(107,36);
> b1.src = ""> > b2 = new Image(107,36);
> b2.src = ""> > }
>
>
>
> //image swapping function:
> function hiLite(imgDocID, imgObjName, comment) {
> if (browserVer == 1) {
> document.images[imgDocID].src = "" + ".src");
> window.status = comment; return true;
> }}
> //end hiding -->
>
> > >Thats where I am using the function in CF > > > Login')" >href="" target="Right" class="sml"> >border="0" name="b" src=""> > >Can anyone explain me when a link is active how can I keep the Redbutton >not the white one?? > > > >Shahzad.Butt >Ph: +44 (0) 1992 701 722 >Fax: +44 (0) 1992 701 604 > > > _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Javascript Help Required
You have a Syntax error... You missed the double quotes on the first image. b1.src = ""> >From: "Shahzad.Butt" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: CF-Talk <[EMAIL PROTECTED]> >Subject: _javascript_ Help Required >Date: Tue, 30 Dec 2003 11:40:34 - > >Hi > >I am using following script to change the image for a button on >mouseOver (red button) and mouseOut (white button). What I can not >achieve or I dont know how to do is when link is active then display >image which I am using on mouseOver > >
>
> if (browserVer == 1) {
> b1 = new Image(107,36);
> b1.src = ""> > b2 = new Image(107,36);
> b2.src = ""> > }
>
>
>
> //image swapping function:
> function hiLite(imgDocID, imgObjName, comment) {
> if (browserVer == 1) {
> document.images[imgDocID].src = "" + ".src");
> window.status = comment; return true;
> }}
> //end hiding -->
>
> > >Thats where I am using the function in CF > > > Login')" >href="" target="Right" class="sml"> >border="0" name="b" src=""> > >Can anyone explain me when a link is active how can I keep the Redbutton >not the white one?? > > > >Shahzad.Butt >Ph: +44 (0) 1992 701 722 >Fax: +44 (0) 1992 701 604 > > > [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Javascript Help Required
Hi I am using following script to change the image for a button on mouseOver (red button) and mouseOut (white button). What I can not achieve or I dont know how to do is when link is active then display image which I am using on mouseOver
if (browserVer == 1) {
b1 = new Image(107,36);
b1.src = ""> b2 = new Image(107,36);
b2.src = ""> }
//image swapping function:
function hiLite(imgDocID, imgObjName, comment) {
if (browserVer == 1) {
document.images[imgDocID].src = "" + ".src");
window.status = comment; return true;
}}
//end hiding -->
Thats where I am using the function in CF Login')" href="" target="Right" class="sml"> border="0" name="b" src=""> Can anyone explain me when a link is active how can I keep the Redbutton not the white one?? Shahzad.Butt Ph: +44 (0) 1992 701 722 Fax: +44 (0) 1992 701 604 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Javascript Help
Thanks works a treat Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485 - Fax: 03 9699 7976 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Javascript Help
I would use the function called split() which makes an array based on a delimiter passed in (in your case the comma). Then you can loop over the array or access the elements as you need: var x = 'test1,test2,test3,test4'; arElements = x.split(','); would result in... arElements[0] = 'test1' arElements[1] = 'test2' arElements[2] = 'test3' arElements[3] = 'test4' HTH, Mike _ From: Andrew Scott [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 10:03 PM To: CF-Talk Subject: _javascript_ Help Looking for any help in being able to do the following. I am looking at a string "test,test1,test2,test3", and what I would like to do is get the value of these from the form variable sounds simple enough. But how to I get the item out of the string using _javascript_. In coldfusion I would used ListGetAt, but I can't seem to find anything in JS to do this. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485 - Fax: 03 9699 7976 _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Javascript Help
"test,test1,test2,test3".split(',') will create an array -Original Message- From: Andrew Scott [mailto:[EMAIL PROTECTED] Sent: Friday, 19 December 2003 3:03 p.m. To: CF-Talk Subject: _javascript_ Help Looking for any help in being able to do the following. I am looking at a string "test,test1,test2,test3", and what I would like to do is get the value of these from the form variable sounds simple enough. But how to I get the item out of the string using _javascript_. In coldfusion I would used ListGetAt, but I can't seem to find anything in JS to do this. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485 - Fax: 03 9699 7976 _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Javascript Help
Looking for any help in being able to do the following. I am looking at a string "test,test1,test2,test3", and what I would like to do is get the value of these from the form variable sounds simple enough. But how to I get the item out of the string using _javascript_. In coldfusion I would used ListGetAt, but I can't seem to find anything in JS to do this. Regards Andrew Scott Technical Consultant NuSphere Pty Ltd Level 2/33 Bank Street South Melbourne, Victoria, 3205 Phone: 03 9686 0485 - Fax: 03 9699 7976 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: form/javascript help
Where can I find the drop-in HTML editor in DWMX? Phillip B. www.LoungeRoyale.com www.FillWorks.com - Original Message - From: "Joshua Miller" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2003 9:00 PM Subject: RE: form/javascript help > Oops, I totally overlooked that part of the requirement. You could dig > into some of the HTML editors that are floating around out there. I > noticed recently that DWMX has a drop-in HTML editor as an object. ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: OT form javascript help
function makeBold(elem_id) { var start_text = ''; var end_text = ''; if (document.layers || window.opera) return; else if (document.all) { selected_text = document.selection.createRange(); new_text = "" + selected_text.text + ""; selected_text.text = new_text; } else if (document.getSelection) { elem = document.getElementById(elem_id); start_pos = elem.selectionStart; end_pos = elem.selectionEnd + start_text.length; elem.value = elem.value.slice(0,start_pos) + start_text + elem.value.slice(start_pos); elem.value = elem.value.slice(0,end_pos) + end_text + elem.value.slice(end_pos); } } hello Should work in IE4+(pc) and Gecko. I'd do this a bit differently if you wanted to extend it beyond just bold tags though. Just replace tfield with tfield_input in the onclick for it to work for the single line input. Adapted from: http://placenamehere.com/Mozilla/js_textareas.html http://www.xs4all.nl/~ppk/js/selected.html http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20110399.html -- mailto:[EMAIL PROTECTED] Thursday, August 21, 2003, 2:43:06 PM, you wrote: PB> I know this can be done but I stink at java script. I want to select some PB> text in a text field. Then click a graphic on the page and have it put an PB> HTML tag around the selected text in the form field. Any idea on how to do PB> this or where to find the code that does this? PB> Phillip B. PB> www.LoungeRoyale.com PB> www.FillWorks.com PB> ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com
RE: form/javascript help
Oops, I totally overlooked that part of the requirement. You could dig into some of the HTML editors that are floating around out there. I noticed recently that DWMX has a drop-in HTML editor as an object. Joshua Miller Head Programmer / IT Manager Garrison Enterprises Inc. www.garrisonenterprises.net [EMAIL PROTECTED] (704) 569-0801 ext. 254 * Any views expressed in this message are those of the individual sender, except where the sender states them to be the views of Garrison Enterprises Inc. This e-mail is intended only for the individual or entity to which it is addressed and contains information that is private and confidential. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying is strictly prohibited. If you have received this e-mail in error please delete it immediately and advise us by return e-mail to [EMAIL PROTECTED] * -Original Message- From: Barney Boisvert [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 6:14 PM To: CF-Talk Subject: RE: form/javascript help that will wrap the entire form field value. I don't think that it's possible to wrap only a portion with javascript. --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com > -Original Message- > From: Joshua Miller [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 2:21 PM > To: CF-Talk > Subject: RE: form/javascript help > > > > function wrapWithTag(formObj,tagname){ > formObj.value="<"+tagname+">"+formObj.value+"</"+tagname+">"; > } > > > > > > > onclick="wrapWithTag(myform.mytext,'b');"> > > > Joshua Miller > Head Programmer / IT Manager > Garrison Enterprises Inc. > www.garrisonenterprises.net [EMAIL PROTECTED] > (704) 569-0801 ext. 254 > > ** > ** > * > Any views expressed in this message are those of the individual sender, > except where the sender states them to be the views of > Garrison Enterprises Inc. > > This e-mail is intended only for the individual or entity to which it > is addressed and contains information that is private and > confidential. If you are not the intended recipient you are hereby > notified that any dissemination, distribution or copying is strictly > prohibited. If you have received this e-mail in error please delete it > immediately and advise us by return e-mail to > [EMAIL PROTECTED] > ******** > * > > > -Original Message- > From: Phillip B [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 1:26 PM > To: CF-Talk > Subject: OT: form/javascript help > > > I know this can be done but I stink at java script. I want to select > some text in a text field. Then click a graphic on the page and have > it put an HTML tag around the selected text in the form field. Any > idea on how to do this or where to find the code that does this? > > Phillip B. > > www.LoungeRoyale.com > www.FillWorks.com > > > ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: form/javascript help
I'm not sure how well this will work in Netscape... but it definately works in IE 5.0 and above... function doBoldText(){ var mySelection = document.selection.createRange(); var tmpText = mySelection.text; tmpText = "<b>" + tmpText + "</b>"; mySelection.text = tmpText; } HTH, Jeff Garza - Original Message - From: "Barney Boisvert" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, August 21, 2003 3:13 PM Subject: RE: form/javascript help that will wrap the entire form field value. I don't think that it's possible to wrap only a portion with javascript. --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com > -Original Message- > From: Joshua Miller [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 2:21 PM > To: CF-Talk > Subject: RE: form/javascript help > > > > function wrapWithTag(formObj,tagname){ > formObj.value="<"+tagname+">"+formObj.value+"</"+tagname+">"; > } > > > > > > > onclick="wrapWithTag(myform.mytext,'b');"> > > > Joshua Miller > Head Programmer / IT Manager > Garrison Enterprises Inc. > www.garrisonenterprises.net > [EMAIL PROTECTED] > (704) 569-0801 ext. 254 > > > * > Any views expressed in this message are those of the individual sender, > except where the sender states them to be the views of > Garrison Enterprises Inc. > > This e-mail is intended only for the individual or entity to which it is > addressed and contains information that is private and confidential. If > you are not the intended recipient you are hereby notified that any > dissemination, distribution or copying is strictly prohibited. If you > have received this e-mail in error please delete it immediately and > advise us by return e-mail to [EMAIL PROTECTED] > > * > > > -Original Message- > From: Phillip B [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 1:26 PM > To: CF-Talk > Subject: OT: form/javascript help > > > I know this can be done but I stink at java script. I want to select > some text in a text field. Then click a graphic on the page and have it > put an HTML tag around the selected text in the form field. Any idea on > how to do this or where to find the code that does this? > > Phillip B. > > www.LoungeRoyale.com > www.FillWorks.com > > > ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
RE: form/javascript help
that will wrap the entire form field value. I don't think that it's possible to wrap only a portion with javascript. --- Barney Boisvert, Senior Development Engineer AudienceCentral [EMAIL PROTECTED] voice : 360.756.8080 x12 fax : 360.647.5351 www.audiencecentral.com > -Original Message- > From: Joshua Miller [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 2:21 PM > To: CF-Talk > Subject: RE: form/javascript help > > > > function wrapWithTag(formObj,tagname){ > formObj.value="<"+tagname+">"+formObj.value+"</"+tagname+">"; > } > > > > > > > onclick="wrapWithTag(myform.mytext,'b');"> > > > Joshua Miller > Head Programmer / IT Manager > Garrison Enterprises Inc. > www.garrisonenterprises.net > [EMAIL PROTECTED] > (704) 569-0801 ext. 254 > > > * > Any views expressed in this message are those of the individual sender, > except where the sender states them to be the views of > Garrison Enterprises Inc. > > This e-mail is intended only for the individual or entity to which it is > addressed and contains information that is private and confidential. If > you are not the intended recipient you are hereby notified that any > dissemination, distribution or copying is strictly prohibited. If you > have received this e-mail in error please delete it immediately and > advise us by return e-mail to [EMAIL PROTECTED] > **** > * > > > -Original Message- > From: Phillip B [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 21, 2003 1:26 PM > To: CF-Talk > Subject: OT: form/javascript help > > > I know this can be done but I stink at java script. I want to select > some text in a text field. Then click a graphic on the page and have it > put an HTML tag around the selected text in the form field. Any idea on > how to do this or where to find the code that does this? > > Phillip B. > > www.LoungeRoyale.com > www.FillWorks.com > > > ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com
OT form javascript help
I know this can be done but I stink at java script. I want to select some text in a text field. Then click a graphic on the page and have it put an HTML tag around the selected text in the form field. Any idea on how to do this or where to find the code that does this? Phillip B. www.LoungeRoyale.com www.FillWorks.com ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: form/javascript help
function wrapWithTag(formObj,tagname){ formObj.value="<"+tagname+">"+formObj.value+"</"+tagname+">"; } Joshua Miller Head Programmer / IT Manager Garrison Enterprises Inc. www.garrisonenterprises.net [EMAIL PROTECTED] (704) 569-0801 ext. 254 * Any views expressed in this message are those of the individual sender, except where the sender states them to be the views of Garrison Enterprises Inc. This e-mail is intended only for the individual or entity to which it is addressed and contains information that is private and confidential. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying is strictly prohibited. If you have received this e-mail in error please delete it immediately and advise us by return e-mail to [EMAIL PROTECTED] * -Original Message- From: Phillip B [mailto:[EMAIL PROTECTED] Sent: Thursday, August 21, 2003 1:26 PM To: CF-Talk Subject: OT: form/javascript help I know this can be done but I stink at java script. I want to select some text in a text field. Then click a graphic on the page and have it put an HTML tag around the selected text in the form field. Any idea on how to do this or where to find the code that does this? Phillip B. www.LoungeRoyale.com www.FillWorks.com ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Get the mailserver that powers this list at http://www.coolfusion.com
OT: form/javascript help
I know this can be done but I stink at java script. I want to select some text in a text field. Then click a graphic on the page and have it put an HTML tag around the selected text in the form field. Any idea on how to do this or where to find the code that does this? Phillip B. www.LoungeRoyale.com www.FillWorks.com ~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Slight OT: JavaScript Help
Thanks Isaac, I'll file both of those away - great ideas. -Original Message- From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:47 AM To: CF-Talk Subject: RE: Slight OT: JavaScript Help Just as an FYI, you can also use window.opener.location.reload() or place onfocus="location.reload()" in the body tag of the page which opens the popup. Either of these will give you slightly different results, so it's a matter of figuring out which is the right tool for this particular job. :) Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 > You get the Guru trophy of the day (I think it's a 9 year old twinkie). > That is exactly what I needed. > -mk > -Original Message- > From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:54 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > I think it is something like > window.opener.location=('yourlocation.cfm'); > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > Folks, > Some JavaScript guru out there can answer this in a second. I have a form > window with a link that "pops up" a simple form to add some piece or > pieces > of data to a lookup table. When the user is done adding, I want them to > click a button and have the window close - and the page behind it refresh. > I > can close the window no problem (onclick='window.close()') - but I cannot > figure out how to get the original page to refresh. Of course cflocation > doesn't help me because it puts the page into the "pop-up" window, which I > want to get rid of after the add operation. Anyone have a quick solution > to > this? > -mk > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. 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: Slight OT: JavaScript Help
Just as an FYI, you can also use window.opener.location.reload() or place onfocus="location.reload()" in the body tag of the page which opens the popup. Either of these will give you slightly different results, so it's a matter of figuring out which is the right tool for this particular job. :) Isaac Dealey Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 > You get the Guru trophy of the day (I think it's a 9 year old twinkie). > That is exactly what I needed. > -mk > -Original Message- > From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:54 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > I think it is something like > window.opener.location=('yourlocation.cfm'); > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > Folks, > Some JavaScript guru out there can answer this in a second. I have a form > window with a link that "pops up" a simple form to add some piece or > pieces > of data to a lookup table. When the user is done adding, I want them to > click a button and have the window close - and the page behind it refresh. > I > can close the window no problem (onclick='window.close()') - but I cannot > figure out how to get the original page to refresh. Of course cflocation > doesn't help me because it puts the page into the "pop-up" window, which I > want to get rid of after the add operation. Anyone have a quick solution > to > this? > -mk > __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm 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: Slight OT: JavaScript Help
Kris - thanks. I'll give it a try. -mk -Original Message- From: Kris Pilles [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:26 AM To: CF-Talk Subject: RE: Slight OT: JavaScript Help var callerWindowObj = dialogArguments; callerWindowObj.retssn = document.frmName.employees.value; callerWindowObj.retname = document.forms["frmName"].employees.options[document.forms["frmName"].em ployees.selectedIndex].text; -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:26 AM To: CF-Talk Subject: Re: Slight OT: JavaScript Help - Original Message - From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, September 12, 2002 7:17 AM Subject: RE: Slight OT: JavaScript Help > Ok - how would I do that? could I use the window.opener object like > "window.opener.form[index]" type syntax to add? > > I would need to be able to append a new item to an existing select > box. The > "value" would be an int and the text would be a string. In other > words, in > html: My pet shop - I have to be able to > set both of these items. I'm sure it's possible, but I've not done it > before. > Hi Mark: opener.formName.selectName[opener.formName.selectName.options.length] = new Option("text", "value"); (where 'text' is the text that shows up in the drop-down, and 'value' is the value of the option). hth, charlie > -mk > > > -Original Message- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:56 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > > > Why do you want to refresh the window? > > Why not just have javascript pass the values back to the form and > close the top window? > > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > > > Folks, > > Some JavaScript guru out there can answer this in a second. I have a > form window with a link that "pops up" a simple form to add some piece > or pieces of data to a lookup table. When the user is done adding, I > want them to click a button and have the window close - and the page > behind it refresh. I can close the window no problem > (onclick='window.close()') - but I cannot figure out how to get the > original page to refresh. Of course cflocation doesn't help me because > it puts the page into the "pop-up" window, which I want to get rid of > after the add operation. Anyone have a quick solution to this? > > -mk > > > > > __ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm 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: Slight OT: JavaScript Help
Charlie, Thanks a lot. I appreciate the help from sunny AZ. -mk -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:26 AM To: CF-Talk Subject: Re: Slight OT: JavaScript Help - Original Message - From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, September 12, 2002 7:17 AM Subject: RE: Slight OT: JavaScript Help > Ok - how would I do that? could I use the window.opener object like > "window.opener.form[index]" type syntax to add? > > I would need to be able to append a new item to an existing select box. The > "value" would be an int and the text would be a string. In other words, in > html: My pet shop - I have to be able to set > both of these items. I'm sure it's possible, but I've not done it before. > Hi Mark: opener.formName.selectName[opener.formName.selectName.options.length] = new Option("text", "value"); (where 'text' is the text that shows up in the drop-down, and 'value' is the value of the option). hth, charlie > -mk > > > -Original Message- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:56 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > > > Why do you want to refresh the window? > > Why not just have javascript pass the values back to the form and close > the top window? > > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > > > Folks, > > Some JavaScript guru out there can answer this in a second. I have a > form window with a link that "pops up" a simple form to add some piece > or pieces of data to a lookup table. When the user is done adding, I > want them to click a button and have the window close - and the page > behind it refresh. I can close the window no problem > (onclick='window.close()') - but I cannot figure out how to get the > original page to refresh. Of course cflocation doesn't help me because > it puts the page into the "pop-up" window, which I want to get rid of > after the add operation. Anyone have a quick solution to this? > > -mk > > > > > __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm 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: Slight OT: JavaScript Help
var callerWindowObj = dialogArguments; callerWindowObj.retssn = document.frmName.employees.value; callerWindowObj.retname = document.forms["frmName"].employees.options[document.forms["frmName"].em ployees.selectedIndex].text; -Original Message- From: Charlie Griefer [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 10:26 AM To: CF-Talk Subject: Re: Slight OT: JavaScript Help - Original Message - From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, September 12, 2002 7:17 AM Subject: RE: Slight OT: JavaScript Help > Ok - how would I do that? could I use the window.opener object like > "window.opener.form[index]" type syntax to add? > > I would need to be able to append a new item to an existing select > box. The > "value" would be an int and the text would be a string. In other > words, in > html: My pet shop - I have to be able to > set both of these items. I'm sure it's possible, but I've not done it > before. > Hi Mark: opener.formName.selectName[opener.formName.selectName.options.length] = new Option("text", "value"); (where 'text' is the text that shows up in the drop-down, and 'value' is the value of the option). hth, charlie > -mk > > > -----Original Message- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:56 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > > > Why do you want to refresh the window? > > Why not just have javascript pass the values back to the form and > close the top window? > > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > > > Folks, > > Some JavaScript guru out there can answer this in a second. I have a > form window with a link that "pops up" a simple form to add some piece > or pieces of data to a lookup table. When the user is done adding, I > want them to click a button and have the window close - and the page > behind it refresh. I can close the window no problem > (onclick='window.close()') - but I cannot figure out how to get the > original page to refresh. Of course cflocation doesn't help me because > it puts the page into the "pop-up" window, which I want to get rid of > after the add operation. Anyone have a quick solution to this? > > -mk > > > > > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. 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: Slight OT: JavaScript Help
- Original Message - From: "Mark A. Kruger - CFG" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, September 12, 2002 7:17 AM Subject: RE: Slight OT: JavaScript Help > Ok - how would I do that? could I use the window.opener object like > "window.opener.form[index]" type syntax to add? > > I would need to be able to append a new item to an existing select box. The > "value" would be an int and the text would be a string. In other words, in > html: My pet shop - I have to be able to set > both of these items. I'm sure it's possible, but I've not done it before. > Hi Mark: opener.formName.selectName[opener.formName.selectName.options.length] = new Option("text", "value"); (where 'text' is the text that shows up in the drop-down, and 'value' is the value of the option). hth, charlie > -mk > > > -Original Message- > From: Kris Pilles [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 8:56 AM > To: CF-Talk > Subject: RE: Slight OT: JavaScript Help > > > Why do you want to refresh the window? > > Why not just have javascript pass the values back to the form and close > the top window? > > -Original Message- > From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 12, 2002 9:45 AM > To: CF-Talk > Subject: Slight OT: JavaScript Help > > > Folks, > > Some JavaScript guru out there can answer this in a second. I have a > form window with a link that "pops up" a simple form to add some piece > or pieces of data to a lookup table. When the user is done adding, I > want them to click a button and have the window close - and the page > behind it refresh. I can close the window no problem > (onclick='window.close()') - but I cannot figure out how to get the > original page to refresh. Of course cflocation doesn't help me because > it puts the page into the "pop-up" window, which I want to get rid of > after the add operation. Anyone have a quick solution to this? > > -mk > > > > > __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. 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: Slight OT: JavaScript Help
Ok - how would I do that? could I use the window.opener object like "window.opener.form[index]" type syntax to add? I would need to be able to append a new item to an existing select box. The "value" would be an int and the text would be a string. In other words, in html: My pet shop - I have to be able to set both of these items. I'm sure it's possible, but I've not done it before. -mk -Original Message- From: Kris Pilles [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 8:56 AM To: CF-Talk Subject: RE: Slight OT: JavaScript Help Why do you want to refresh the window? Why not just have javascript pass the values back to the form and close the top window? -Original Message- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:45 AM To: CF-Talk Subject: Slight OT: JavaScript Help Folks, Some JavaScript guru out there can answer this in a second. I have a form window with a link that "pops up" a simple form to add some piece or pieces of data to a lookup table. When the user is done adding, I want them to click a button and have the window close - and the page behind it refresh. I can close the window no problem (onclick='window.close()') - but I cannot figure out how to get the original page to refresh. Of course cflocation doesn't help me because it puts the page into the "pop-up" window, which I want to get rid of after the add operation. Anyone have a quick solution to this? -mk __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm 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: Slight OT: JavaScript Help
You get the Guru trophy of the day (I think it's a 9 year old twinkie). That is exactly what I needed. -mk -Original Message- From: Bryan F. Hogan [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 8:54 AM To: CF-Talk Subject: RE: Slight OT: JavaScript Help I think it is something like window.opener.location=('yourlocation.cfm'); -Original Message- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:45 AM To: CF-Talk Subject: Slight OT: JavaScript Help Folks, Some JavaScript guru out there can answer this in a second. I have a form window with a link that "pops up" a simple form to add some piece or pieces of data to a lookup table. When the user is done adding, I want them to click a button and have the window close - and the page behind it refresh. I can close the window no problem (onclick='window.close()') - but I cannot figure out how to get the original page to refresh. Of course cflocation doesn't help me because it puts the page into the "pop-up" window, which I want to get rid of after the add operation. Anyone have a quick solution to this? -mk __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm 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: Slight OT: JavaScript Help
Why do you want to refresh the window? Why not just have javascript pass the values back to the form and close the top window? -Original Message- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:45 AM To: CF-Talk Subject: Slight OT: JavaScript Help Folks, Some JavaScript guru out there can answer this in a second. I have a form window with a link that "pops up" a simple form to add some piece or pieces of data to a lookup table. When the user is done adding, I want them to click a button and have the window close - and the page behind it refresh. I can close the window no problem (onclick='window.close()') - but I cannot figure out how to get the original page to refresh. Of course cflocation doesn't help me because it puts the page into the "pop-up" window, which I want to get rid of after the add operation. Anyone have a quick solution to this? -mk __ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm 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: Slight OT: JavaScript Help
I think it is something like window.opener.location=('yourlocation.cfm'); -Original Message- From: Mark A. Kruger - CFG [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 9:45 AM To: CF-Talk Subject: Slight OT: JavaScript Help Folks, Some JavaScript guru out there can answer this in a second. I have a form window with a link that "pops up" a simple form to add some piece or pieces of data to a lookup table. When the user is done adding, I want them to click a button and have the window close - and the page behind it refresh. I can close the window no problem (onclick='window.close()') - but I cannot figure out how to get the original page to refresh. Of course cflocation doesn't help me because it puts the page into the "pop-up" window, which I want to get rid of after the add operation. Anyone have a quick solution to this? -mk __ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. 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