While users want to submit some information to your server then it will be similar to HTML Form WML will provide a mechanism to submit user data to web server.
To perform this action in WML, you need the <go>...</go> along with <postfield/> tags. The <postfield/> tag should be enclosed in the <go>...</go> tag pair.
You can submit data to a server, by collecting all the set WML variables and use <postfield> elements to send them to the server. The <go>...</go> elements are used to set posting method to either POST or GET and to mention a specific server side script to manage the uploaded data.
We have already discussed about different ways of taking inputs form the users. These input elements sets WML variables to the entered values. Let’s see how to take values from WML variables. See the following example shows how to submit three fields name, age and sex to the server.
Once you download the above code on your WAP device, then it will provide you an option to enter three fields name, age and sex and one link Submit Data. After entering these three fields then select Submit Data link to send entered data to the server.
The method attribute of the <go> tag mentioned about the type of HTTP method to be used to send the form data.
Incase if the HTTP POST method is used, the form data to be sent will be placed in the message body of the request. If you use the HTTP GET method then the form data to be sent will be appended to the URL. However a URL includes a limited number of characters. The GET method has the disadvantage of a size limit to send the data where the user data contains non-ASCII characters, you need to use the POST method to avoid encoding problems.
Let’s find the difference between HTML and WML. In HTML, the name attribute of the <input> and <select> tags is used to define the name of the parameter to be sent, while in WML the name attribute of the <postfield> tag is used to do the same thing. In WML, the name attribute of <input> and <select> is used to mention the name of the variable for storing the form data.
Let’s discuss about how to handle uploaded data at server end in next chapter.
WML Related Interview Questions
|XML Interview Questions||HTML Interview Questions|
|HTML 5 Interview Questions||Adobe Flex Interview Questions|
|Dynamic HTML Interview Questions||XHTML Interview Questions|
|Java XML Interview Questions||XMLHttpRequest (XHR) Interview Questions|
|Advanced jQuery Interview Questions||ebXML Interview Questions|
|WAP Interview Questions||Xml Publisher Interview Questions|
|Security Assertion Markup Language (Saml) Interview Questions||Windows Workflow Foundation Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.