tailieunhanh - Processing Validated Data

Chế biến xác nhận dữ liệu Nhiệm vụ cuối cùng cho các ứng dụng của chúng tôi là để gửi tất cả dữ liệu xác nhận đến một máy chủ để xử lý. Chúng tôi sẽ sử dụng một đối tượng LoadVars để hoàn thành mục tiêu này. 1. Mở . Chúng tôi sẽ tiếp tục xây dựng trên dự án từ các tập thể dục trước đó. | Processing Validated Data The last task for our application is to send all the validated data to a server for processing. We ll use a LoadVars object to accomplish this goal. 1. Open . We ll continue building on the project from the preceding exercise. 2. With the Actions panel open select Frame 1 of the Actions layer and add the following script at the top of the current script just below the stop action 3. 4. var registrationData LoadVars new LoadVars 5. This creates a new LoadVars object named registrationData. In the next step we will add a script that places our validated data into this object and sends it to the server. 3. Add the following script to the else leg of the validateForm function 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. http registrationData 15. 16. POST 17. When all the data entered into the form is valid the actions in the else part of the validateForm function including this section of script are executed. The first four lines of the script place the data in the various Textinput instances into the registrationData object. The last line sends this data to a server-side script. NOTE For the last line of script you should insert the URL to a script on your server for processing the data. Or if you simply want to do a final test of your code use this URL http cftemplates . The ColdFusion page at this URL will send you email containing the validated data. The else part of this script already had an action that would send the application to the Confirm label automatically when all the data entered was valid. Because the application is now set up to send data to a server let s change this functionality a bit so that the application only moves to that frame label after a response has been received from the