[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-306628-105":53,"doc-detail-306628-en":127},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":120,"head_meta":122,"extra_data":124,"updated_unix":126},105,"en","html-forms-theory-and-procedure","HTML Forms - Theory and Procedure","","HTML Forms explains how to collect user data on a website using form elements and attributes. It introduces the \u003Cform> syntax and covers common attributes such as name, action, method (GET/POST), target, and enctype with supported encoding types. The guide then details form controls used to gather inputs, including text, password, multi-line fields, checkboxes, radio buttons, select boxes, file inputs, hidden controls, and submit/reset buttons, with step-by-step examples using HTML elements like \u003Cinput> and \u003Ctextarea>.",{"@graph":63,"@context":119},[64,80,102],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/html-forms-theory-and-procedure/306628/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/html-forms-theory-and-procedure/306628.png","ImageObject",442,249,{"name":88,"@type":89},"Elsa","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-27","2026-09-19",true,{"@type":98,"interactionType":99,"userInteractionCount":101},"InteractionCounter",{"@type":100},"ViewAction",22,{"@type":103,"mainEntity":104},"FAQPage",[105,111,115],{"name":106,"@type":107,"acceptedAnswer":108},"What is the purpose of HTML forms on a website?","Question",{"text":109,"@type":110},"HTML Forms collect data from site visitors. The submitted input is sent to a back-end script (e.g., CGI, ASP, or PHP) for processing.","Answer",{"name":112,"@type":107,"acceptedAnswer":113},"Which form attributes are commonly used with \u003Cform>?",{"text":114,"@type":110},"Common attributes include name, action (script URL), method (GET or POST), target (where results display), and enctype (how data is encoded before sending).",{"name":116,"@type":107,"acceptedAnswer":117},"How do single-line, password, and multi-line inputs differ?",{"text":118,"@type":110},"Single-line inputs are created with \u003Cinput type=\"text\">, password inputs with \u003Cinput type=\"password\"> to mask characters, and multi-line inputs with \u003Ctextarea> for longer text entries.","https://schema.org",{"og:url":78,"og:type":121,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":123,"canonical":78},"index,follow",{"doc_id":125,"site_id":56},306628,1791348786,{"code":4,"msg":5,"data":128},{"doc_id":125,"user_id":129,"nickname":88,"user_avatar":130,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":131,"file_id":132,"file_url":133,"file_type":134,"file_size":135,"view_count":101,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":15,"language":136,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":137,"faqs":138,"seo_title":139,"seo_description":61,"update_tm":140,"read_time":79},137455077381,"https://ap-avatar.wpscdn.com/davatar_994ba38a5ba835b3df7d355c54d3ed8d","HTML Forms  \nTheory:  \nHTML Forms are required when you want to collect some data from the site visitor, for example, registration information: name, email address, credit card, etc. A form will take input from the site visitor and then will post your back-end application such as CGI, ASP Script or PHP script etc. Then your back-end application will do required processing on that data in whatever way you like. Form elements are like text fields, text-area fields, drop-down menus, radio buttons, checkboxes, etc. which are used to take information from the user. A simple syntax of using \u003Cform> is as shown in figure 1.  \nFigure 1: Shows A simple syntax of using \u003Cform>  \nMost frequently used form attributes are:  \n• name: This is the name of the form.  \n• action: Here you will specify any script URL which will receive uploaded data.  \n• method: Here you will specify method to be used to upload data. It can take various values but most frequently used are GET and POST.  \n• target: It specifies the target page where the result of the script will be displayed. It takes values like _blank, _self, _parent etc.  \n• enctype: You can use the enctype attribute to specify how the browser encodes the data before it sends it to the server. Possible values are like:  \n❖ application/x-www-form-urlencoded - This is the standard method most forms use. It converts spaces to the plus sign and no alphanumeric characters into the hexadecimal code for that character in ASCII text.  \n❖ mutlipart/form-data-This allows the data to be sent in parts, with each consecutive part corresponding the a form control, in the order they appear in the form. Each part can have an optional content-type header of its own indicating the type of data for that form control.  \nThere are different types ofform controls that you can use to collect data from a visitor to your site.  \n• Text input controls  \n• Buttons  \n• Checkboxes and radio buttons  \n• Select boxes  \n• File select boxes  \n• Hidden controls  \n• Submit and reset button  \nThere are actually three types of text input used on forms:  \n• Single-line text input controls: Used for items that require only one line of user input, such as search boxes or names. They are created using the \u003Cinput> element.  \n• Password input controls: Single-line text input that mask the characters a user enters.  \n• Multi-line text input controls: Used when the user is required to give details that may be longer than a single sentence. Multi-line input controls are created with the \u003Ctextarea> element.  \nProcedure:  \nOpen Notepad or another text editor to create a basic HTML document to do the following examples:  \n1- Single-line text input controls: Single-line text input controls are created using an \u003Cinput> element whose type attribute has a value of text. Do a basic example of a single-line text input used to take first name and last name, as shown in the following figure 2.  \nFigure 2: Shows a single-line text input  \nThis will produce following result that is shown in the figure 3.  \n\n| |\n| --- |\n|  |\n\nFigure 3: Shows the execution result of using a single-line text input  \nFollowing is the list of attributes for \u003Cinput> tag:  \n• type: Indicates the type of input control you want to create. This element is also used to create other form controls such as radio buttons and checkboxes.  \n• name: Used to give the name part of the name/value pair that is sent to the server, representing each form control and the value the user entered.  \n• value: Provides an initial value for the text input control that the user will see  \nwhen the form loads.  \n• size: Allows you to specify the width of the text-input control in terms of characters.  \n• maxlength: Allows you to specify the maximum number of characters a user can enter into the text box.  \n2- Password input controls: This is also a form of single-line text input controls are created using an \u003Cinput> element whose type attribute has a value of password. Do a basic example of a single-lin","cbCaie606V6z79cx","https://ap.wps.com/l/cbCaie606V6z79cx","pdf",451196,"English","# HTML Forms\n## Theory\n## Procedure","[{\"question\":\"What is the purpose of HTML forms on a website?\",\"answer\":\"HTML Forms collect data from site visitors. The submitted input is sent to a back-end script (e.g., CGI, ASP, or PHP) for processing.\"},{\"question\":\"Which form attributes are commonly used with \\u003cform\\u003e?\",\"answer\":\"Common attributes include name, action (script URL), method (GET or POST), target (where results display), and enctype (how data is encoded before sending).\"},{\"question\":\"How do single-line, password, and multi-line inputs differ?\",\"answer\":\"Single-line inputs are created with \\u003cinput type=\\\"text\\\"\\u003e, password inputs with \\u003cinput type=\\\"password\\\"\\u003e to mask characters, and multi-line inputs with \\u003ctextarea\\u003e for longer text entries.\"}]","HTML Forms - Theory and Procedure | PDF",1789839048]