Form Decode

  • The Form Decode script is subject to change without notification. Should you notice problems with the Form Decode, please check this page to see if there have been any changes.
  • The Form Decode script may be subject to short term or permanent removal.
  • If you have any questions about this or any other CGI script, please contact Asahi Net.

Below we will introduce the essential Form Decode tag that you need to place into your HTML file, the composite elements of the a form (text field, radio buttons, pull-down menus, check boxes, and text boxes) and finish with a sample. Essential tags (without them your form will not work) are clearly marked as such.

Using Form Decode

  1. To use Form Decode, you will take the tags mentioned below and place them into your HTML file (anywhere inside the main body <BODY> - </BODY> ) using a text editor or your homepage creation software.
  2. You will upload that HTML file to the FTP server using your FTP software.
  3. The operation of Form Decode can then be confirmed by opening the uploaded HTML page in a Web browser.

Notes

  • Please use the Form Decode tag that corresponds to the homepage service that you are using.
  • Please enter the Form Decode tag accurately.

The Opening Tag

This is an essential tag.

This example Form Decode tag tells the Web browser where to send the data that has been input into your form. The tag shown is specific to the Individual Homepage service.

<form ACTION="http://cgi.asahi-net.or.jp/cgi-bin/formdecode.cgi" METHOD="POST">

Each homepage service has a different tag. Please refer to the List Of Form Decode Tags below for the correct Form Decode to put in your script.

List Of Form Decode Tags


Type of Homepage Service
Form Decode tag
Individual Homepage <form ACTION="http://cgi.asahi-net.or.jp/cgi-bin/formdecode.cgi" METHOD="POST">
FreeAddress <form ACTION="http://cgi.www.ne.jp/cgi-bin/formdecode.cgi" METHOD="POST">
MMJP Homepage <form ACTION="https://cgi.mmjp.or.jp/cgibin/formdecode.cgi" METHOD="POST">
Virtual Domain
Web Hosting
<form ACTION="http://vcgi.mmjp.or.jp/cgi-bin/formdecode.cgi" METHOD="POST">
SSL Server <form ACTION="https://www.mmjp.or.jp/cgibin/formdecode.cgi" METHOD="POST">

Text Field

The following is an example of a tag to create a text field in your form. The example allows up to 30 characters to be entered into the text field. Data that has been entered into the text field is sent to you by email, and will be listed in the email prefixed with 'NAME=' to let you know which field it came from.

Name: <input type="text" name="NAME" size="30">
Name:

Radio Buttons

Radio buttons allow you to provide a multiple choice question, but the visitor to your homepage is limited to one answer.

In this example where you ask the person's gender, no one can claim to be both male and female.

Male: <input type="radio" name="GENDER" value="MALE">
Female: <input type="radio" name="GENDER" value="FEMALE">

Male: Female:

Pull-down Boxes

Pull-down boxes are another way to provide one-answer-only multiple choice questions.

Who is your favorite Beatle?
<SELECT NAME="FAV_BEATLE" SIZE="1">


<OPTION SELECTED>John</OPTION>
<OPTION>Paul</OPTION>
<OPTION>George</OPTION>
<OPTION>Ringo</OPTION>
<OPTION>Volkswagon</OPTION>


<OPTION>Who are the Beatles?</OPTION>
</SELECT>


Who is your favorite Beatle?

Check Boxes

Check boxes can be used to for multiple questions to allow the visitor to your homepage to provide two or more answers.

In this example, people who have been to all the continents can check all the boxes.

Continents Visited:
[Africa: <input type="checkbox" name="AFR" value="YES">]
[Antarctica: <input type="checkbox" name="ANT" value="YES">]
[Asia: <input type="checkbox" name="ASIA" value="YES">]
[Europe: <input type="checkbox" name="EUR" value="YES">]
[Australia: <input type="checkbox" name="AUS" value="YES">]
[North America: <input type="checkbox" name="NA" value="YES">]

Continents Visited:
[Africa: ] [Antarctica: ] [Asia: ] [Europe: ] [Australia: ] [North America: ] [South America: ]

Text Area Box

The text area provides an area to enter an unlimited number of lines of text (up to 32k).

  • Include "WRAP" within the TEXTAREA tag to make typing long lines a little easier for the people who use your form.
  • Text included between "<TEXTAREA>" and "</TEXTAREA>" tags will show up in the text area box, but may be erased by the person filling out the form.

<textarea name="COMMENT" ROWS="5" COLS="45" WRAP>Enter your comment here...</textarea>

Tell Form Decode Where To Send The Data

This is an essential tag.

Form Decode needs to know to which email address to send the data that has been input into the form. This example shows the email address randy@asahi.email.ne.jp being assigned as the email address. Please use your own email address instead of this example.

<input type=hidden NAME="_to" VALUE="randy@asahi.email.ne.jp">

Assign A Subject

If you leave this tag out, the subject of the email you receive containing input data will be (output from formdecode.cgi). So for the "value=" part of the tag, please enter your own subject.

<input type="hidden" name="_subject" value="Enter any subject here...">

Controlling What Happens After Submit Is Pressed

After clicking the Submit button on your form, you can take the user to another one of your pages, such as a "Thank you" page you have created, by using one of the following tags.

Method 1

Enter a filename of an html page to be displayed:
<input type="hidden" name="_accept_html" value="filename.html">

filename.html should indicate an HTML file within the same directory as the webform. Don't include http://... etc., just the filename.

Method 2

Enter the URL of a file to be displayed after submit is pressed:
<input type="hidden" name="_accept_url" value="http://www.asahi-net.or.jp/en/index.html">

Send and Reset Buttons

These are essential.

No form can work without these buttons. Here are two examples.
<input type="submit" value="Send">   <input type="reset" value="Reset">

  

The 'value' is optional. If you leave it out, the default buttons will read the Japanese equivalent of 'Submit' and 'Reset'.

Closing Tag

An essential tag.

Last but not least, don't forget this tag to indicate the end of the form.

</form>

Example Form

Here's an example form made combining the Table tag and the Form Decode CGI tags.

Vote for Your Favorite Movie
Name:
Email:
Age group: 15 years or younger
16 ~ 25 years old
26 ~ 35 years old
36 ~ 55 years old
55 years or older

I watch movies on/in/at:

[Television ] [Video ] [Movie Theaters ] [Cable TV ] [Satellite TV ]


My favorite movie of 2005 was:

Comments:

You can fill this form out, but clicking the Vote button will only send you to the top of this page. The Source Code below is the source that made this form - you may copy it and modify it for your own use if you wish.

Source Code

These are the HTML tags and Form Decode tags used to create the Example Form above.

<table border=0>
<tr align=center><td colspan=2>
<b>Vote for Your Favorite Movie</b>
</tr></td>

<FORM ACTION="http://cgi.asahi-net.or.jp/cgi-bin/formdecode.cgi" METHOD=POST>

<tr><td align=right>Name:</td><td align=left><input type="text"
name="NAME" size="30">
</td></tr>

<tr><td align=right>Email:</td><td align=left><input type="text"
name="EMAIL" size="30">
</td></tr>

<tr><td align=right valign=top>Age group:</td><td align=left>
<input type="radio" name="AGE" value="15-">15 years or younger<br>
<input type="radio" name="AGE" value="16-25">16 ~ 25 years old<br>
<input type="radio" name="AGE" value="26-35">26 ~ 35 years old<br>
<input type="radio" name="AGE" value="36-55">36 ~ 55 years old<br>
<input type="radio" name="AGE" value="55+">55 years or older<br>
</td></tr>

<tr><td colspan=2><hr></td></tr>

<tr align=center><td colspan=2>
<B>I watch movies on/in/at:</B><p>
[Television <input type="checkbox" name="TV" value="YES">]
[Video <input type="checkbox" name="VIDEO" value="YES">]
[Movie Theaters <input type="checkbox" name="THEATER" value="YES">]
[Cable TV <input type="checkbox" name="CABLE" value="YES">]
[Satellite TV <input type="checkbox" name="SATELLITE" value="YES">]
</td></tr>

<tr><td colspan=2><hr></td></tr>

<tr><td align=right valign=top>My favorite movie of 2005 was:</td>
<td align=left><SELECT NAME="FAV_MOVIE" SIZE="1">
<OPTION SELECTED>Batman Begins
<OPTION>Star Wars
<OPTION>Harry Potter
<OPTION>Wallace and Gromit
<OPTION>War of the Worlds
<OPTION>Sideways
</SELECT>

<tr><td colspan=2><hr></td></tr>

<tr><td colspan=2 align=middle>Comments:
<textarea name="COMMENT" ROWS="7" COLS="45"></textarea>
</td></tr>

<input type=hidden NAME=_to VALUE="ab3c-defg@asahi-net.or.jp">

<tr><td align=right><input type="submit" value="Vote"></td>
<td align=left><input type="reset" value="Start over">
</td></tr>

</form>

</table>