populate cf variable using javascript array
Hello, I would like to know if it's possible to set a coldfusion variable from a javascript array? If so how? What I really want to do is populate a cfinput with the values from the javascript array. Thanks, Charlie ~| 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:331616 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: populate cf variable using javascript array
Hey Charlie, Once the 'cfinput' is viewed in the browser, it is translated into a regular input statement (view source to see) Javascript only runs after the page is translated to the regular input statement, so you should be able to interact with that input with javascript directly (no need to translate the javascript array into a coldfusion array) If you give more details of what you want to do, we can probably help. William -- William E. Seiter On Mar 11, 2010, Charles Heizer heiz...@llnl.gov wrote: Hello, I would like to know if it's possible to set a coldfusion variable from a javascript array? If so how? What I really want to do is populate a cfinput with the values from the javascript array. Thanks, Charlie ~| 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:331617 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: populate cf variable using javascript array
Here is with JQuery: rry = []; $(input :checkbox :checked).each(function({ rry.push($(this).val(); }); $(input[name=textinput]).val(rry); Sorry, I'm not a big native javascript guy. Much easier with JQuery. ~| 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:331623 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm