1 / 10

Technologies for web publishing

Technologies for web publishing. Ing. Václav Freylich. Lecture 4. Content. Forms in HTML. HTML forms. Allows the user-page interactivity Used for the user data input Offer a lot of controls Posted form is processed on the web server by dynamic website (script). Forms - syntax.

dacia
Download Presentation

Technologies for web publishing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Technologies for web publishing Ing. Václav Freylich Lecture 4

  2. Content • Forms in HTML aTNPW1-4

  3. HTML forms • Allows the user-page interactivity • Used for the user data input • Offer a lot of controls • Posted form is processed on the web server by dynamic website (script) aTNPW1-4

  4. Forms - syntax Form body <form></form> Most important attributes: action URL address of the script (form processing) method data sending method - GET / PUT (implicitly GET) aTNPW1-4

  5. Forms – data sending methods Data sending methods get - data values are the part of the URL address - used for short forms with the text data - data values are visible in URL – DANGEROUS ! post - data values are sent to the web server separately - used for large forms, passwords, files, … aTNPW1-4

  6. Forms - syntax Input control – input (always non-pair element) <input type="text" name= "user" value= "User name" size="10" maxlength="15" /> type control type text, password, checkbox, radio, submit, reset, button, image, hidden, file name control name value initial value of the control aTNPW1-4

  7. Forms - syntax Buttons <input type="submit" name="frm_submit" value="Submit form" /> type control type = button function (submit, reset) name control name value button caption aTNPW1-4

  8. Forms - syntax Textarea (pair element) <textarea cols="50" rows="5" name="myarea"></textarea> Pair element for longer text input rows number of visible rows cols width (number of chars on the row) Textarea control has automatic scroll bars available if the total length of the text is longer than the textarea size aTNPW1-4

  9. Forms - syntax Select box Contains the items - option elements Values of selected items only are sent to the server <select name="sel_items" size="3" multiple="multiple"> <option value="1" selected="selected">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> <option value="4">Item 4</option> </select> size number of visible items multiple allows multiple selection aTNPW1-4

  10. Forms - syntax Control group – <fieldset></fieldset> For grouping the controls (the set has a visual border) Fieldset caption - <legend></legend> - Crerates the caption of the control group made byfieldset <form action="some_script.php" method="post"> <fieldset> <legend>User login</legend> Login<input type="text" name= "login" size="10" /> Password<input type="password" name= "pwd" size="10" /> <input type="submit" value= "Enter" /> </fieldset> </form> aTNPW1-4

More Related