WML <postfield> Tag

Advertisements


The <postfield> tag is used to post variables values to the server.

Attributes:

This element supports the following attributes:

AttributeValueDescription
namestringSets the name of the variable
valuestringSets the value of the variable
classclass dataSets a class name for the element.
idelement IDA unique ID for the element.

Example:

Following example shows how to submit three fields name, age and sex to the server.

<?xml version="1.0"?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">

<wml>

<card id="card1" title="WML Form">
<p>
   Name: <input name="name" size="12"/>

   Sex : <select name="sex">
      <option value="male">Male</option>
      <option value="female">Female</option>
      </select>

   Age :  <input name="age" size="12" format="*N"/>
   <anchor>
      <go method="get" href="process.php">
          <postfield name="name" value="$(name)"/>
          <postfield name="age" value="$(age)"/>
          <postfield name="sex" value="$(sex)"/>
      </go>
      Submit Data
    </anchor>
</p>
</card>

</wml>

When you download above code on your WAP device, it will provide you option to enter three fields name, age and sex and one link Submit Data. You will enter three fields and then finally you will select Submit Data link to send entered data to the server.



Advertisements
Advertisements