Shawn, let's start with how you could generate the XML packet. This is
just one way:

(Assume you have done your form checking already.)

<cfxml variable="packet">
 <ALERT_SUBSCRIPTION>
    <COMPANY CORPORATE_MASTER_ID="#form.companycorporate_master_id#">
         <MEMBERS>
              <MEMBER>
              <EMAIL_ADDRESS>#form.email#</EMAIL_ADDRESS>
              <ALERTS>
                     <ALERT SUBSCRIBE="<cfif
isDefined("form.event")>YES<cfelse>NO</cfif>">EVENT</ALERT>
                                <!--- repeat for other alerts --->
              </ALERTS>
              </MEMBER>
         </MEMBERS>
     </COMPANY>
 </ALERT_SUBSCRIPTION>
</cfxml>
 
Basically, you use <cfxml> and write out the XML packet as you need it,
replacing hard coded values with form values. Once you have it, you can
post it to the other server by using CFHTTP and CFHTTPParam. 

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Shawn Contreras [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, August 23, 2003 8:20 PM
> To: CF-Talk
> Subject: Making an XML file from an HTML form and sending it!
> 
> 
> First, let me begin by saying that I'm a newbie and if it 
> wasn't for this forum I'd have given up on Cold Fusion long 
> ago... so thank you all for your assistance.  As a result, I 
> have become committed to learning and promoting Cold Fusion 
> primarily because of the web community support and 
> responsiveness it is unprecedented even by other Macromedia 
> product communities!  An application can be great (of which 
> I'm learning Cold Fusion
> is) but the community is what makes it successful!
> 
> OK, with that being said... I'm having quite a bit of 
> confusion with this
> Cold Fusion MX XML Webservice task.   Here's what I want to do:
> 
> Step 1:  Create HTML FORM with check boxes and email address 
> area (required
> field) for user to submit (Subscribe).
> 
> Step 2:  Upon completion and user pressing Submit 
> (Subscribe), the form info is processed into an XML file 
> named "alert_subscription.xml"
> 
> Step 3:  This new XML file is then sent to another server via 
> the HTML FORM POST to then be processed into their data structure.
> 
> I've purchased several books CFMX Bible, Mastering CFMX, 
> Forta's Application Development... and have concluded that 
> the answer lies somewhere with using either <CFXML> or XMLNew().
> 
> Below is my Step 1 but don't know how to write the code for 
> CFMX to process the other Steps 2 & 3.  There is some 
> javascript in there and I'll include that in another post if 
> requested.  Please help!
> 
> Thanks in advance for your help!
> 
> B. Regards,
> 
> Shawn Contreras
> 
> 
> <form method="POST" action="???" target="_self">
>                 <input type=hidden name="default_alert" 
> value="EVENT,true,MEDIA,true,NEWS,true,PRESENTATION,true,REPOR
> T,true,SEC,tru
> e">
>                 <input type=hidden name="alert_hname" 
> value="(ignore)"> <input type=hidden name="COMPANY 
> CORPORATE_MASTER_ID" value="123456">
>                 <table border="0" cellpadding="3" 
> cellspacing="0" width="100%">
>                   <!------------------- MORE THAN
> ONE ------------------------------>
>                   <tr>
>                     <td colspan="2"><font size="-2" 
> face="arial, helvetica, sans-serif" color="#000000">
>                       <div id="EMAIL_ALERT"><b>E-mail Alert 
> Selection</b></div>
>                       </font></td>
>                   </tr>
>                   <tr>
>                     <td width="5%"></td>
>                     <td><font size="-2" face="arial, 
> helvetica, sans-serif" color="#000000">
>                       <div id="EMAIL_ALERT"></div>
>                       </font></td>
>                   </tr>
>                   <tr>
>                     <td width="5%"></td>
>                     <td><font size="-2" face="arial, 
> helvetica, sans-serif" color="#000000">
>                       <div id="EMAIL_ALERT"><font size="-2" 
> face="arial, helvetica, sans-serif" color="#000000"> E-mail 
> alerts are messages that are conveniently delivered to
>                         your e-mail box whenever certain new 
> company information
>                         is posted to this site. </font>To 
> automatically receive
>                         e-mail alerts, choose the information 
> categories from the list below
>                         that interest you, enter your e-mail 
> address and click
>                         on the Subscribe button.</div>
>                       </font></td>
>                   </tr>
>                   <tr>
>                     <td width="5%"></td>
>                     <td><font size="-2" face="arial, 
> helvetica, sans-serif" color="#000000">
>                       <div id="EMAIL_ALERT">
>                         <input type=checkbox name="EVENT">
>                         <b>Event Alert</b><br>
>                         <input type=checkbox name="MEDIA">
>                         <b>Audio Archive Alert</b><br>
>                         <input type=checkbox name="NEWS">
>                         <b>News Alert</b><br>
>                         <input type=checkbox name="PRESENTATION">
>                         <b>Presentation Alert</b><br>
>                         <input type=checkbox name="REPORT">
>                         <b>Annual Report Alert</b><br>
>                         <input type=checkbox name="SEC">
>                         <b>SEC Filing Alert</b><br>
>                       </div>
>                       </font> </td>
>                   </tr>
>                   <!------------------- EITHER ONE OR
> MANY ------------------------------>
>                   <tr>
>                     <td colspan="2" align="center"><font 
> size="-2" face="arial, helvetica, sans-serif" color="#000000">
>                       <div id="EMAIL_ALERT"><b>Enter your 
> e-mail address:</b>
>                         <input type=text size=25 
> name="SUBSCRIBER_EMAIL" value="" onKeyPress="if 
> (event.keyCode==13) return validate_alert_form(this.form);">
>                         <input type="submit" name="submit" 
> value="Subscribe" onClick="return validate_alert_form(this.form);">
>                       </div>
>                       </font> </td>
>                   </tr>
>                 </table>
>               </form>
> 
> Here is what a successful XML submission should look like:
> 
> <ALERT_SUBSCRIPTION>
>    <COMPANY CORPORATE_MASTER_ID="123456">
>         <MEMBERS>
>              <MEMBER>
>              <EMAIL_ADDRESS>[EMAIL PROTECTED]</EMAIL_ADDRESS>
>              <ALERTS>
>                     <ALERT SUBSCRIBE="YES">EVENT</ALERT>
>                     <ALERT SUBSCRIBE="NO">MEDIA</ALERT>
>                     <ALERT SUBSCRIBE="YES">NEWS</ALERT>
>                     <ALERT SUBSCRIBE="NO">PRESENTATION</ALERT>
>                     <ALERT SUBSCRIBE="NO">REPORT</ALERT>
>                     <ALERT SUBSCRIBE="YES">SEC</ALERT>
>              </ALERTS>
>              </MEMBER>
>         </MEMBERS>
>     </COMPANY>
> </ALERT_SUBSCRIPTION>
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

Reply via email to