When the solution matters

Tips...

Registration Documentation Knowledgebase Seminars / Training Technical Support Partner Central

Surveys

Congratulations! You've done the hard part. Now we just need to create a couple of HTML pages. First, though, you should create a "WebFolder" folder in the same folder as your SurveyDB file. AFter you have done that, go to your text editor and create a new document. Enter the following into it:

<html>
<head>
<title>4D Web Survey</title>
</head>
<body bgcolor="#FFFFFF">
<form name="Beverages" action="/4DACTION/WebSurveyHandler/" method="post" >
<p>
<input type="hidden" name="form_name" value="Beverages">
Your Name: <input type="text" name="WEBF_Name" maxlength="80">
</p>
<p>
Your age: <input type="text" name="WEBF_Age" maxlength="3" size="3">
</p>
<p>
Sex:
<input type="radio" name="WEBF_Sex" value="Male" checked> Male
<input type="radio" name="WEBF_Sex" value="Female"> Female
</p>
<p>Check all that apply:</p>
<p>
<input type="checkbox" name="WEBF_LikeCoffee" value="Yes">
I like Coffee
</p>
<p>
<input type="checkbox" name="WEBF_LikeTea" value="Yes">
I like Tea
</p>
<p>
<input type="checkbox" name="WEBF_LikeBeer" value="Yes">
I like Beer
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>

Save the file as "index.html" in the WebFolder, located in the same directory as you have saved the 4D database.

Next we will create another file with the text editor. Enter the following into it:

<html>
<head>
<title>Answers</title>
</head>
<body bgcolor="#FFFFFF">
<h1>Thanks for your answers!</h1>
<table width="75%" border="1">
<!--4DLOOP [Answers]-->
<tr>
<td><!--4DVAR [Answers]Question--></td>
<td><!--4DVAR [Answers]Answer--></td>
</tr>
<!--4DENDLOOP-->
</table>
</body>
</html>

Save the file as "answers.html" and put it in the WebFolder as well.

The hard part is now out of the way. The last bit of set-up that is required is in Database Properties. Please make sure that your Web Server Settings look like this:

screenshot

Note that the Web Server is set to run at Startup and responds on Port 80. The default HTML root is "WebFolder" and the default Home Page is "index.html". Also, we will Start without Context.

Now you are ready to start testing! Before you proceed, make sure that the 4D Web Server is running. Once the web server is running, launch your web browser and enter "127.0.0.1" into the address bar. Your web page should look something like this:

screenshot

Enter some information for the name, age, and click a few check boxes before you click the Submit button. When you do, you should see a results page that perhaps looks like this:

screenshot

 Previous Step  1 2 3 4 5 6  Next Step


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