When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

Room 4 Rent

The Applicants Detail page collects some basic information about the Applicant.

If you view the Source for this web page, you can determine what happens when the user clicks the "Continue" button:

<form name="applicant_details" action="/4DACTION/WSC_FormPost/applicant_info" method="post" >

As you should be able to tell, the WSC_FormPost method will handle the processing of this form. You can see that "applicant_info" is being passed as a parameter to WSC_FormPost. Let us examine a section of WSC_FormPost:

The value from $tFormName was passed as a parameter to this method - in this case, $tFormName will be "applicant_info" which was passed as a parameter to this method. As you can see from the Case statement above, if $tFormName="applicant_info" then the WSC_ApplicantInfoSave method is called.

If we are calling WSC_ApplicantInfoSave, why didn't we just define the HTML form like this?

<form name="applicant_details" action="/4DACTION/WSC_ApplicantInfoSave" method="post" >

That's an option. But building a centralised form handler is a good idea. This allows you to do some general pre- and post-processing of all forms, if you want to. In this application, we only do a small amount of this. Look at the next piece of WSC_FormPost:

In this case, we are just handling whatever errors have been generated. You could easily add extra post-processing, such as e-mail notification of certain types of errors.

Now let's check out WSC_ApplicantInfoSave:

There isn't a lot of complicated stuff going on here. Some rudimentary checks are made: did the user supply an e-mail address? Is there an @ symbol and a . in the e-mail address? Do we have write access to the [Applicants] record, so we may update it? More checks could be made: is the Social Security Number properly formatted? How about the phone number? Is the Monthly_Income deemed sufficient? Any errors with the submitted data are sent to the WSC_ErrorMessage, and the error handling itself is handled back in WSC_FormPost. If the data is deemed acceptable, the user is sent the "references.shtml" page.

Previous  1 2 3 4 5 6 7 8 9 10 11 12  Next Step


International | Company | Contact 4D | Site Map | Privacy Policy | © 4D UK 1995-2008 | Change font size: [A] [A] [A] | Print this page