Hi all,

I'm seeking ideas / opinions on the following problem: I want to have form, a 
"Save" and "Cancel" button. When clicking on "Save", it reads the form contents 
and updates the database. The standard way to do this is to do your CFFORM and 
call another CFM file where (action="blabla.cfm") which reads the form 
variables, updates the database and then do a CFLOCATION back to the main 
application. Of course, the CFLOCATION means re-loading the whole app and 
re-initiating your CFC's, etc..etc..

Now I'm into Ajax and using AjaxCFC and think have found a solution to avoid 
the page refresh which is what I'm trying to achieve. I'm also comfortable with 
JS and DOM manipulation, etc...Basically, I keep the CFFORM structure within 
the HTML, replace the "Save" button to be "button" type (and not "submit") with 
an 'onclick' to a new JS function. Within the newly-created JS function (called 
from 'onclick'), I use a combination of getElementbyId's (that is, I place ID's 
on the fields) to read the contents of the fields and place them in an array. 
Finally, I make an Ajax call passing the array and then, finally, in the CFC do 
the work of updating the database.  Then in the JS callback function, the idea 
is to display a message to the user a simple message "Updated" (positioned with 
CSS, etc.)

I don't know if that all makes sense to any of you folks out there. My basic 
question is: am I over-engineering here and / or is there another approach / 
easier way in order to avoid screen-refreshing when processing forms?

Thanks, Andy

Madrid, Spain


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http: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:268147
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