<p> College of the management, economics and information technology Department of Information systems Fall Semester, academic Year 2015/2016 INTERNET TECHNOLOGY LAB Lab 04: Rowspan, Colspan and Form Introduction</p><p>Define the commands that we will use them in our code: Command Description / the output</p><p><rowspan = "2"> To merge rows / two rows will be merged <colpan = "2"> To merge cols / two cols will be merged <form method = "post" action = ""> </form> Create a form, where method = "post" appends form data to the browser request, which contains the protocol (HTTP) and the requested resource’s URL. This method of passing data to the server is transparent—the user doesn’t see the data after the form is submitted. The other possible value, method = "get", appends the form data directly to the end of the URL of the script, where it is visible in the browser’s Address field. Action=” ”: specifies the URL of a script on the web server that will be invoked to process the form’s data. Since we haven’t introduced server-side programming yet, we leave this attribute empty for now. <input name = "attributeName" type = Elements that specify data to provide to the “attribute” value = "Images" /> script that processes the form. An input’s type is determined by its type If the attribute is hidden it should be like the attribute following : Type can be as follow: 1- “checkbox” to create a checkbox element <input type = "hidden" name = "recipient" 2- "radio" to create a radio element value = "[email protected]" /> 3- "submit" : to create a submit button, to submit the forms data to the webserver. 4- “reset”: to rest the form elements to the default status. 5- “hidden”: to create a hidden elements <textarea name = "comments" rows = "4" To create the multi- textbox with 4 rows and cols = "36"> </testarea> 36 columns <Label> </label> To create the label <select name = "rating"> <option selected = To create the drop-down list: "selected">Amazing</option> Where Option is used to insert the data into the drop list.</p><p>1 Selected attribute is used to check the selected value in the list "selected”</p><p>Section01: Using rowspan and colspan (20 minutes) </p><p>Step 1: Open Yourname_NFS230 folder a. Inside the folder create “Lab04” folder b. Inside the folder create a new notepad file with the name “Lab04_S1.html” c.In the same file save any image and using the following name and extension image.jpg d.Write your code in the notepad (by following the below steps) and save the file. e. Click on the file name you will get your first webpage</p><p>Step 2: Write the code as shown below <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title>Tables</title> </head></p><p><body></p><p><h1>Table Example Page</h1></p><p><table border = "1"></p><p><caption>Here is a more complex sample table.</caption></p><p><thead></p><p><tr></p><p><th rowspan = "2"></p><p></p><p></th></p><p><th colspan = "4"></p><p><h1>Camelid comparison</h1></p><p><p>Approximate as of 6/2007</p></p><p></th></p><p></tr> 2 <tr></p><p><th># of Humps</th></p><p><th>Indigenous region</th></p><p><th>Spits?</th></p><p><th>Produces Wool?</th></p><p></tr></p><p></thead></p><p><tbody></p><p><tr></p><p><th>Camels (bactrian)</th></p><p><td>2</td></p><p><td>Africa/Asia</td></p><p><td>Yes</td></p><p><td>Yes</td></p><p></tr></p><p><tr></p><p><th>Llamas</th></p><p><td>1</td></p><p><td>Andes Mountains</td></p><p><td>Yes</td></p><p><td>Yes</td></p><p></tr></p><p></tbody></p><p></table> 3 </body></p><p></html></p><p>The result will be as follow: </p><p>Section 02: Forms (15 minutes) When browsing websites, users often need to provide such information as search keywords, e-mail addresses and zip codes. XHTML provides a mechanism, called a form, for collecting data from a user.</p><p>Data that users enter on a web page is normally sent to a web server that provides access to a site’s resources (e.g., XHTML documents, images). These resources are located either on the same machine as the web server or on a machine that the web server can access through the network. When a browser requests a web page or file that is located on a server, the server processes the request and returns the requested resource. A request contains the name and path of the desired resource and the method of communication (called a protocol). XHTML documents use the Hypertext Transfer Protocol (HTTP).</p><p>Forms can contain visual and nonvisual components. Visual components include clickable buttons and other graphical user interface components with which users interact. Nonvisual components, called hidden inputs, store any data that you specify, such as email addresses and XHTML document filenames that act as links.</p><p>Step 1: Open a Yourname_NFS230 folder a. Go to your desktop. Open an Yourname_INFS230 folder b. Go to folder “Lab04” folder c. Inside the Lab04 folder create a new notepad file with the name “Lab04_S2.html” d. Write your code in the notepad (by following the below steps) and save the file and exit from the file. e. Click on the file name you will get your webpage.</p><p>Step 2: Write the code as shown below <html xmlns = "http://www.w3.org/1999/xhtml"></p><p>4 <head></p><p><title>Forms</title></p><p></head></p><p><body></p><p><h1>Feedback Form</h1></p><p><p>Please fill out this form to help us improve our site.</p></p><p><form method = "post" action = ""></p><p><p><input type = "hidden" name = "recipient" value = "[email protected]" /></p><p><input type = "hidden" name = "subject" value = "Feedback Form" /></p><p><input type = "hidden" name = "redirect" value = "main.html" /></p></p><p><p><label>Name:<input name = "name" type = "text" size = "25"</p><p> maxlength = "30" /> </label></p></p><p><p><input type = "submit" value = "Submit" /></p><p><input type = "reset" value = "Clear" /></p> </form> </body> </html> </p><p>The result will be as follow:</p><p>5 Section 03: Additional Form Elements (50 minutes)</p><p>In the previous example, you saw basic elements of XHTML forms. Now that you know the general structure of a form, we introduce elements and attributes for creating more complex forms.</p><p>Step 1: Open a Yourname_INFS230 folder a. Go to your desktop. Open an Yourname_INFS230 folder b. Go to folder “Lab04” folder c. Inside the Lab4 folder create a new notepad file with the name “Lab04_S3.html” d. Write your code in the notepad (by following the below steps) and save the file and exit from the file. e. Click on the file name you will get your webpage.</p><p>6 Step 2: Write the code as shown below </p><p><html xmlns = "http://www.w3.org/1999/xhtml"></p><p><head></p><p><title>More Forms</title></p><p></head></p><p><body></p><p><h1>Feedback Form</h1></p><p><p>Please fill out this form to help us improve our site.</p></p><p><form method = "post" action = ""></p><p><p><input type = "hidden" name = "recipient" value = "[email protected]" /></p><p><input type = "hidden" name = "subject" value = "Feedback Form" /></p><p><input type = "hidden" name = "redirect" value = "main.html" /> </p></p><p><p><label>Name: <input name = "name" type = "text" size = "25" /> </label></p></p><p><p> <label>Comments:<br /></p><p><textarea name = "comments" rows = "4" cols = "36">Enter comments here.</textarea></p><p></label></p></p><p><p><label>E-mail Address: <input name = "email" type = "password" size = "25" /></p><p></label></p> </p><p>7 <p><strong>Things you liked:</strong><br /></p><p><label>Site design <input name = "thingsliked" type = "checkbox" </p><p> value = "Design" /></label></p><p><label>Links <input name = "thingsliked" type = "checkbox" </p><p> value = "Links" /></label></p><p><label>Ease of use <input name = "thingsliked" type = "checkbox" </p><p> value = "Ease" /></label> </p><p><label>Images <input name = "thingsliked" type = "checkbox" </p><p> value = "Images" /></label></p><p><label>Source code <input name = "thingsliked" type = "checkbox" </p><p> value = "Code" /></label></p></p><p><p><strong>How did you get to our site?:</strong><br /></p><p><label>Search engine <input name = "howtosite" type = "radio" value = "search engine" checked = "checked" /></label></p><p><label>Links from another site <input name = "howtosite" type = "radio" </p><p> value = "link" /></label> </p><p><label>Deitel.com Web site <input name = "howtosite" type = "radio" </p><p> value = "deitel.com" /></label></p><p><label>Reference in a book <input name = "howtosite" type = "radio" value = "book" /></label></p><p><label>Other <input name = "howtosite" type = "radio" value = "other" /></label></p></p><p>8 <p><label>Rate our site: </p><p><select name = "rating"></p><p><option selected = "selected">Amazing</option></p><p><option>10</option></p><p><option>9</option></p><p><option>8</option></p><p><option>7</option></p><p><option>6</option></p><p><option>5</option></p><p><option>4</option></p><p><option>3</option></p><p><option>2</option></p><p><option>1</option></p><p><option>Awful</option></p><p></select></p><p></label></p></p><p><p><input type = "submit" value = "Submit" /></p><p><input type = "reset" value = "Clear" /></p> </p><p></form></p><p></body> </html></p><p>9 The result will be as follow:</p><p>10 Post-Lab: </p><p>1. How to do the following function using the xHTML language a. Merging the rows in the table b. Merging the columns in the table c. Creating the hidden input in the form d. Create the submit button to the form e. Creating the rest button in the form f. Creating the textbox in the form g. Creating the areatext h. Creating a radio element in the form i. Creating the drop list element. j. Creating the label </p><p>2. Why xHTML uses the hidden elements in the webpage. 3. What is the job of the rest button in the form? 4. What is the job of the submit button in the form?</p><p>5. Mention the job of the following tags. </p><p>6.</p><p> <input type = "hidden" name = "recipient" value = "[email protected]" /></p><p> <label>Site design <input name = "thingsliked" type = "checkbox" </p><p> value = "Design" /></label></p><p> <br /></p><p> <textarea name = "comments" rows = "4" cols = "36">Enter comments here.</textarea></p><p> <th rowspan = "2"></p><p> <th colspan = "2"></p><p> <p><label>E-mail Address: <input name = "email" type = "password" size = "25" /> </label></p> </p><p> <input type = "reset" value = "Clear" /></p><p>7. What is the output of the following codes? Explain your answer. Code1: </p><p>11 12 Code2: </p><p>13 4. Write a code that gives you the output as in the figure below, you can use any image inside your computer. </p><p>References: 1- Internet and World Wide Web How to Program: 4/e.</p><p>14</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages14 Page
-
File Size-