Hi, Bryan...

So, I take it from your answer that you're not using .live or .livequery.

.livequery (a pre-jQuery 1.3 plug-in) and .live (core as of 1.3)
are functions that address the issue you're having, it sounds like.

If you have a page rendered in a browser, then load new elements
into the DOM, such as links, buttons, etc., they won't work.

.livequery and .live use event delegation to bind current and future
elements in the DOM to an event.

For example, this code would not work for '#myLink' if it was added to a DOM
via
the jQuery .load function:

$(document).ready(function() {

   $('#myLink').click(function() {

      alert('myLink was clicked');

   });
});

However, the same code, using the .live function (jQuery 1.3 and later) with
allow the .click function to apply to '#myLink' no matter when the elements
is added to the DOM:

$(document).ready(function() {

   $('#myLink').live('click', function() {

      alert('myLink was clicked');

   });
});

You can read more about the .live functionality here:

http://docs.jquery.com/Events/live

hth,

Rick


However,

-----Original Message-----
From: Bryan Stevenson [mailto:[email protected]] 
Sent: Friday, October 23, 2009 11:36 AM
To: cf-talk
Subject: RE: SOT: ajaxCFC/JavaScript/dynamic forms


Hey Rick,

I use jQuery for a tabbed interface and serializing forms....that's it!

I'm realizing there is more I should know about jQuery and it's usage
with ajaxCFC....looking for decent tutorials or docs ;-)

When I say serialize I mean:
str = $("#"+form).serialize();
("form" being the argument passed to the JS function in question)

I simply call a method in a a CFC which creates the HTML string required
via CFSAVECONTENT like so (psuedo of course):

<cfsavecontent>
  <form name="myPopUpForm" id="myPopUpForm>
    [form stuff here]
    [button with onClick="funcToSendFormVIaAJAX('formName')";]
  </form>
</cfsavecontent>

So that HTML string is returned to the client and stuffed in a DIV that
then shows above the base page.  When the button on that form
(myPopUpForm) is pressed, the serialization step seems to fail as it
doesn't seem to "see" the form.

I'd love any info you have on what you asked about!!

TIA

Cheers
-  

Bryan Stevenson B.Comm.
VP & Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: [email protected]
web: www.electricedgesystems.com
 
Notice:
This message, including any attachments, is confidential and may contain
information that is privileged or exempt from disclosure. It is intended
only for the person to whom it is addressed unless expressly authorized
otherwise by the sender. If you are not an authorized recipient, please
notify the sender immediately and permanently destroy all copies of this
message and attachments.






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:327589
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to