IF you use <cfdump var="#form#" />  you should see a struct called "form"
with each of your form fields and their settings from the submitted form.
If you use Daniel Gaspar <http://www.danielgaspar.com/>'s ANYTHINGXOXML.cfc
you can automatically convert it to XML without any effort.
http://anythingtoxml.riaforge.org/


Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month



On Thu, Dec 15, 2011 at 3:43 PM, Tom Jones <[email protected]> wrote:


> Hello,
> I have been searching all over cf-talk archives and on google and I don't
> see a good example on how to save form data to a xml file.
>
> So what I'm doing right now is, I have a xml file and read that and then
> display it in a form so the it can be edited. Here is an example on what
> I'm thinking. What I'm struggling with is the form data is not returned as
> an array of structs where I could easily create a xml file from, it's just
> coma separated lists.
>
> Thanks,
> tom
>
> <!--- Example XML
> <columns>
>    <column>
>        <align>left</align>
>        <dname>Agent Version</dname>
>        <hidden>false</hidden>
>        <idx>2</idx>
>        <name>agent_version</name>
>        <order>2</order>
>        <width>100</width>
>    </column>
>    <column>
>        <align>left</align>
>        <dname>Allow Client</dname>
>        <hidden>false</hidden>
>        <idx>3</idx>
>        <name>AllowClient</name>
>        <order>1</order>
>        <width>100</width>
>    </column>
> </columns>
> --->
> <form name="colSettings" method="post">
> <table width="600" cellpadding="2" cellspacing="1">
> <tr>
>        <th>Order</th>
>        <th>Display Name</th>
>        <th>Align Text</th>
>        <th>Hide</th>
>        <th>Column Width</th>
> </tr>
> <cfloop index="x" array="#sortedColsArray#">
> <tr>
> <cfoutput>
>        <td><input type="text" name="order" size="3" value="#x.order#"></td>
>        <td><input type="text" name="dname" size="50"
> value="#x.dname#"></td>
>        <td><input type="text" name="align" size="10"
> value="#x.align#"></td>
>        <td><input type="text" name="hidden" size="3"
> value="#x.hidden#"></td>
>        <td><input type="text" name="width" size="10"
> value="#x.width#"></td>
> </cfoutput>
> </tr>
> </cfloop>
> </table>
> <input name="submit" type="submit" value="Save" />
> </form>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349159
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to