Add the following script to the else leg of the validateForm() function:
registrationData.name = name_ti.text;
registrationData.email = email_ti.text;
registrationData.state = state_ti.text;
registrationData.zip = zip_ti.text;
registrationData.sendAndLoad("http://www.myDomain.com/registration.php",¬
registrationData, "POST");
When all the data entered into the form is valid, the actions in the
else part of the
validateForm() functionincluding this section of scriptare executed.
The first four lines of the script place the data in the various TextInput instances into the
registrationData instance. 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.
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 server, indicating that the submitted data has been received and processed.