Hi, Bryan...

Are you using the .live functionality (jQuery 1.3 and above)
or the .livequery method for links, buttons, etc., that are
added to the DOM?

Rick

-----Original Message-----
From: Bryan Stevenson [mailto:[email protected]] 
Sent: Thursday, October 22, 2009 5:45 PM
To: cf-talk
Subject: SOT: ajaxCFC/JavaScript/dynamic forms


Hi All,

I'm not the best when it comes to JavaScript and I've got a question
about forms that are created in a CFC method and then passed back to the
client to be displayed in a DIV (meant to look like a pop-up).

SCENARIO:
-------------------------------------------------------------------------
1) JS function is included when page is rendered and references a form
that does not yet exist.

2) User clicks a button which fires an AJAX call to create an HTML
string and passes it back to the client to be displayed in a hidden DIV
(which is then made visible).  The HTML string includes the form tags to
define the form that the JS function mentioned above references along
with some form prompts.

3) User enters some stuff in the form prompts and then clicks a button
to submit.  That submit calls the function mentioned in number 1 above.
In that call I use jQuery to serialize the form.
-------------------------------------------------------------------------

Now if I use jQuery (which I'm quite new to as well) to serialize a form
that exists at the time the page renders, everything works correctly.

If I do it as outlined in the scenario above, my AJAX calls fail.  From
what I can tell it is because the dynamically created and added form
does NOT seem to be seen and thus the serialization of it fails
(essentially I think it doesn't see the form and produces a  blank
string).

I'm pretty sure I have figured out what's happening, but I have no idea
how to solve it.

Any ideas?

Thanks a bunch in advance!!

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

Reply via email to