I am not nearly good at AJAX, but I assume you would have to loop through
the form elements:

For (var strKey in objForm.elements){
        Var objElement = objForm.elements[strKey];

        // Check which type of element it is (NOT SURE OF SYNTAX HERE)
        Switch (objElement.type){
                Case "input":
                        objFormValues[strKey] = objElement.value;
break;
                case "select":
                        .... get value ... break;

        }
}


// Then create a form post in AJAX and encrypt the form variables that were
put into (objFormValues). 



That is a really poor example as I don't know ajax, not have a I ever passed
a form without a page post... but I think that is the main idea.

.......................
Ben Nadel 
Web Developer
Nylon Technology
6 West 14th Street
New York, NY 10011
212.691.1134
212.691.3477 fax
www.nylontechnology.com

"Vote for Pedro"

-----Original Message-----
From: Bryan Stevenson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 15, 2005 5:17 PM
To: CF-Talk
Subject: AJAX related: onClick grab all form elements

Hey All,

Now that I'm looking into AJAX, I'm wondering how I can grab the values of
ALL form elements with an onClick event?

I'd like to grab them all as a structure or array and send the FORM scope
off to a CFC to perform server-side validation and passback the results
(i.e. avoid the full form post and page refresh as you'd have in normal
server-side validation).

Hopefully that was clear enough ;-)

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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:227131
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

Reply via email to