{"id":240,"date":"2007-09-18T00:00:00","date_gmt":"2007-09-18T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=240"},"modified":"2007-09-18T00:00:00","modified_gmt":"2007-09-18T00:00:00","slug":"Submitting Form Data to the Server in XHTML MP","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=240","title":{"rendered":"Submitting Form Data to the Server in XHTML MP"},"content":{"rendered":"<p><DIV><br \/><P><FONT class=mainText>In the previous sections of this XHTML MP tutorial, we have mentioned about how to use selection lists and various input elements to obtain data from a user in XHTML MP. However, the user data has no use if it is not posted to the server for further processing. To post data to the server in XHTML MP, you need the &lt;form&gt;&lt;\/form&gt; tags and a submit button. Let&#8217;s first have a look at the following XHTML MP example. Then we will go into the details.<\/FONT><\/P><br \/><P><FONT class=codeText>&lt;?xml version=&#8221;1.0&#8243;?&gt;<BR>&lt;!DOCTYPE html PUBLIC &#8220;-\/\/WAPFORUM\/\/DTD XHTML Mobile 1.0\/\/EN&#8221; &#8220;http:\/\/www.wapforum.org\/DTD\/xhtml-mobile10.dtd&#8221;&gt;<BR><BR>&lt;html xmlns=&#8221;http:\/\/www.w3.org\/1999\/xhtml&#8221;&gt;<BR>&nbsp;&nbsp;&lt;head&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;XHTML MP Tutorial&lt;\/title&gt;<BR>&nbsp;&nbsp;&lt;\/head&gt;<BR><BR>&nbsp;&nbsp;&lt;body&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;Registration Form&lt;\/h1&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;form method=&#8221;get&#8221; action=&#8221;processing.asp&#8221;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Username:&lt;br\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input name=&#8221;username&#8221;\/&gt;&lt;br\/&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Password:&lt;br\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;password&#8221; name=&#8221;password&#8221;\/&gt;&lt;br\/&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Gender:&lt;br\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;radio&#8221; name=&#8221;gender&#8221; value=&#8221;m&#8221;\/&gt;Male<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;radio&#8221; name=&#8221;gender&#8221; value=&#8221;f&#8221;\/&gt;Female&lt;br\/&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Country:&lt;br\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;select name=&#8221;country&#8221;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;ca&#8221;&gt;Canada&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;cn&#8221;&gt;China&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;fr&#8221;&gt;France&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;de&#8221;&gt;Germany&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;in&#8221;&gt;India&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;it&#8221;&gt;Italy&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;jp&#8221;&gt;Japan&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;kr&#8221;&gt;Korea&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;uk&#8221;&gt;United Kingdom&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;option value=&#8221;us&#8221;&gt;United States&lt;\/option&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/select&gt;&lt;br\/&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Which part of our XHTML MP tutorial do you like?&lt;br\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;checkbox&#8221; name=&#8221;tutorial_part&#8221; value=&#8221;1&#8243;\/&gt;Part 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;checkbox&#8221; name=&#8221;tutorial_part&#8221; value=&#8221;2&#8243;\/&gt;Part 2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;checkbox&#8221; name=&#8221;tutorial_part&#8221; value=&#8221;3&#8243;\/&gt;Part 3<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;checkbox&#8221; name=&#8221;tutorial_part&#8221; value=&#8221;4&#8243;\/&gt;Part 4<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;hidden&#8221; name=&#8221;temp_id&#8221; value=&#8221;123456&#8243;\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/p&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hr\/&gt;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;submit&#8221;\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input type=&#8221;reset&#8221;\/&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/p&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/form&gt;<BR>&nbsp;&nbsp;&lt;\/body&gt;<BR>&lt;\/html&gt;<\/FONT><\/P><br \/><P><BR><\/P><br \/><P><br \/><TABLE cellSpacing=0 cellPadding=4 width=\"100%\" border=0><br \/><COLGROUP><br \/><COL width=128><br \/><COL width=128><br \/><THEAD><br \/><TR vAlign=top><br \/><TD width=\"50%\"><br \/><P><IMG height=162 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_mb8b5c58.png\" width=130 align=left border=0 name=image74><BR clear=left><BR><BR><\/P><br \/><P><IMG height=162 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_m7f611acd.png\" width=130 align=left border=0 name=image75><BR clear=left><BR><BR><\/P><br \/><P><IMG height=162 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_m7b21bd08.png\" width=130 align=left border=0 name=image76><BR clear=left><BR><BR><\/P><br \/><P><IMG height=162 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_3782430.png\" width=130 align=left border=0 name=image77><BR clear=left><FONT class=mainText>Sony Ericsson T610<\/FONT><\/P><\/TD><br \/><TD width=\"50%\"><br \/><P><IMG height=166 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_m56f011b9.png\" width=134 align=left border=0 name=image78><BR clear=left><BR><BR><\/P><br \/><P><IMG height=166 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_7ca46f7b.png\" width=134 align=left border=0 name=image79><BR clear=left><BR><BR><\/P><br \/><P><IMG height=166 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_665dccf7.png\" width=134 align=left border=0 name=image80><BR clear=left><BR><BR><\/P><br \/><P><IMG height=166 src=\"http:\/\/www.developershome.com\/wap\/xhtmlmp\/xhtml_mp_tutorial_html_m6169d414.png\" width=134 align=left border=0 name=image81><BR clear=left><FONT class=mainText>Nokia Mobile Browser 4.0<\/FONT><\/P><\/TD><\/TR><\/THEAD><br \/><TBODY><\/TBODY><\/TABLE><\/P><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous sections of this XHTML MP tutorial, we have mentioned about how to use selection lists and various input elements to obtain data from a user in XHTML MP. However, the user data has no use if it is not posted to the server for further processing. To post data to the server &hellip; <a href=\"https:\/\/www.strongd.net\/?p=240\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Submitting Form Data to the Server in XHTML MP<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-240","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=240"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/240\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}