When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

WebForms

Many forms have fields that are mandatory. For instance, if you are ordering something on-line, you must usually supply a credit card number. If you don't supply this information, you cannot proceed. Typically, the web site will return the form back to your web browser, with the values you entered into the form still intact. It's easy to accomplish the same behavior with 4th Dimension.

Return to your text editor, and open up the index.html file you have been working with. Replace the contents of the file with the following:

<html>
<head>
<title>4D Web Forms</title>
</head>
<body>
<!--4DVAR WSC_t_ErrorMessage-->
<form name="TestForm" method="POST" action="/4DCGI/form3">
Please supply:
<P>
Full Name: <input type="text" name="WSC_t_NameFull" value="<!--4DVAR WSC_t_NameFull-->">
<BR>
Social Security Number: <input type="text" name="WSC_t_SSN" value="<!--4DVAR WSC_t_SSN-->">
<BR>
<input type="submit" name="submitbutton" value="submit">
</form>
</body>
</html>

screenshot

The index.html file in your text editor should now look like the one in the picture above.

This index.html file has a couple of key differences from the ones we've used thus far in this exercise. First, the <form> action:

action="/4DCGI/form3"

Notice that we are not using /4DACTION as we did before - now we are using /4DCGI. If you will recall from earlier in this tutorial, making a request to 4D using /4DCGI will cause the On Web Connection method to run.

Also notice that we are now using the 4DVAR tag: <!--4DVAR WSC_t_ErrorMessage-->, <!--4DVAR WSC_t_NameFull--> and <!--4DVAR WSC_t_SSN-->. As you by now know, the contents of a 4DVAR tag will be replaced when the file is sent out with whatever data is specified. In this example, the specified data are the WSC_t_ErrorMessage, WSC_t_NameFull and WSC_t_SSN variables.

Please save the changes to the index.html file before proceeding to the next step.

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


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