c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.



Similar documents
JavaScript and Dreamweaver Examples

Internet Technologies

2- Forms and JavaScript Course: Developing web- based applica<ons

Working with forms in PHP

Configuring iplanet 6.0 Web Server For SSL and non-ssl Redirect

Intell-a-Keeper Reporting System Technical Programming Guide. Tracking your Bookings without going Nuts!

CS412 Interactive Lab Creating a Simple Web Form

Website Login Integration

Dynamic Web-Enabled Data Collection

JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. sang.shin@sun.com

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

In order for the form to process and send correctly the follow objects must be in the form tag.

HTML Forms and CONTROLS

JavaScript: Arrays Pearson Education, Inc. All rights reserved.

Web Development 1 A4 Project Description Web Architecture

Hello World RESTful web service tutorial

«W3Schools Home Next Chapter» JavaScript is THE scripting language of the Web.

Understanding Cross Site Scripting

People Data and the Web Forms and CGI. HTML forms. A user interface to CGI applications

<option> eggs </option> <option> cheese </option> </select> </p> </form>

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Setup Guide

Client-side Web Engineering From HTML to AJAX

LAB MANUAL CS (22): Web Technology

Further web design: HTML forms

InPost UK Limited GeoWidget Integration Guide Version 1.1

Website Planning Checklist

Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

Lab 5 Introduction to Java Scripts

HTML Tables. IT 3203 Introduction to Web Development

Multimedia im Netz Online Multimedia Winter semester 2015/16. Tutorial 03 Major Subject

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers

HTML Forms. Pat Morin COMP 2405

Chapter 2: Interactive Web Applications

JAVASCRIPT AND COOKIES

Script Handbook for Interactive Scientific Website Building

Fortigate SSL VPN 4 With PINsafe Installation Notes

Web Development CSE2WD Final Examination June (a) Which organisation is primarily responsible for HTML, CSS and DOM standards?

Configuring IBM WebSphere Application Server 7.0 for Web Authentication with SAS 9.3 Web Applications

Chapter 2 HTML Basics Key Concepts. Copyright 2013 Terry Ann Morris, Ed.D

ANGULAR JS SOFTWARE ENGINEERING FOR WEB SERVICES HASAN FAIZAL K APRIL,2014

Short notes on webpage programming languages

Slide.Show Quick Start Guide

ASP (Active Server Pages)

Now that we have discussed some PHP background

Using Form Tools (admin)

Web Programming with PHP 5. The right tool for the right job.

Forms, CGI Objectives. HTML forms. Form example. Form example...

Fortigate SSL VPN 3.x With PINsafe Installation Notes

IMRG Peermap API Documentation V 5.0

CGI.pm Tutorial. Table of content. What is CGI? First Program

Making Web Application using Tizen Web UI Framework. Koeun Choi

Web Server Lite. Web Server Software User s Manual

InternetVista Web scenario documentation

Online Multimedia Winter semester 2015/16

Chapter 22 How to send and access other web sites

Website Implementation

Application Security

WEB DESIGN LAB PART- A HTML LABORATORY MANUAL FOR 3 RD SEM IS AND CS ( )

Viewing Form Results

2. Follow the installation directions and install the server on ccc

JavaScript: Introduction to Scripting Pearson Education, Inc. All rights reserved.

ICT 6012: Web Programming

So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going.

SEEM4540 Open Systems for E-Commerce Lecture 06 Online Payment

ABSTRACT INTRODUCTION %CODE MACRO DEFINITION

CIS 445 Advanced Visual Basic.NET ASP.NET

Novell Identity Manager

Installation & Configuration Guide Version 2.2

Introduction to XHTML. 2010, Robert K. Moniot 1

Yandex.Widgets Quick start

XHTML BASICS. Institute of Finance Management CIT Department Herman Mandari

Installation and Integration Manual TRANZILA Secure 5

Real SQL Programming 1

Web Application Exploits

Sample HP OO Web Application

Tutorial: Using PHP, SOAP and WSDL Technology to access a public web service.

Dynamic Web Pages With The Embedded Web Server. The Digi-Geek s AJAX Workbook

FORM-ORIENTED DATA ENTRY

Slightly more advanced JavaScript

HTML Basics(w3schools.com, 2013)

FORMS. Introduction. Form Basics

How to Make a Working Contact Form for your Website in Dreamweaver CS3

Step by step guides. Deploying your first web app to your FREE Azure Subscription with Visual Studio 2015

Building Web Applications with HTML5, CSS3, and Javascript: An Introduction to HTML5

Transcription:

Practice Problems: These problems are intended to clarify some of the basic concepts related to access to some of the form controls. In the process you should enter the problems in the computer and run them to check for their proper functioning. 1: Working with Radio Buttons <HTML> <HEAD> <TITLE>Extracting Highlighted Radio Button</TITLE> <SCRIPT LANGUAGE="JavaScript">. </SCRIPT> </HEAD> <BODY> <HR> <FORM action = ASPtest.asp method = post > <B>Select the criteria for which you want the points in COMS463:</B><P> <INPUT TYPE="radio" NAME="coms463" VALUE="Project: 40" CHECKED>Project <INPUT TYPE="radio" NAME="coms463" VALUE="Assignment : 10" >Assignment <INPUT TYPE="radio" NAME="coms463" VALUE="Midterm : 25" >Midterm <INPUT TYPE="radio" NAME="coms463" VALUE="Final : 25" >Final<P> <INPUT TYPE="button" NAME="Viewer" VALUE="View 463 Points..." onclick="showpoints63()"> </FORM> <FORM action = ASPtest.asp method = post > <HR><BR> <B> Select the criteria for which you want the points in COMS462:</B><P> <INPUT TYPE="radio" NAME="coms462" VALUE="Programming : 20" >Programming <INPUT TYPE="radio" NAME="coms462" VALUE="Lab Works : 25" CHECKED >Lab Works <INPUT TYPE="radio" NAME="coms462" VALUE="Quiz : 15" >Quiz <INPUT TYPE="radio" NAME="coms462" VALUE="Exam1: 20" >Exam1 <INPUT TYPE="radio" NAME="coms462" VALUE="Final : 20" >Final<P> <INPUT TYPE="button" NAME="Viewer" VALUE="View 462 Points..." onclick="showpoints62()"> </FORM> <HR> </BODY> </HTML> HTML Question: a. Draw the screen output of the above HTML code. JavaScript Questions: a. Write a JavaScript statement to print out on an alert window the number of radio buttons included in the form that has the group name i. coms463 ii. coms462 b. Write a JavaScript statement to print out as an alert box the value of the first Radio button (whether or not selected) in the first form. (Note that JavaScript uses index 0 for the first button) c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form. d. Write JavaScript code segment to assign the value of the selected radio button in the first form to a variable named allocatedpoint1. e. Write a JavaScript statement to print the value of allocatedpoint1 on the screen.

f. Write JavaScript code segment to assign the value of the selected radio button in the second form to a variable named allocatedpoint2. g. Write a JavaScript statement to print the value of allocatedpoint2 on the screen. h. Write JavaScript function that will print on the screen an alert box the sentence In COMS463 the allocated point for followed by the value of the selected radio button in the first form. i. Write JavaScript function that will print on the screen an alert box the sentence In COMS462 the allocated point for followed by the value of the selected radio button in the second form. ASP Questions: a. Write ASP statement to print on the screen the value of the radio button selected when the first form is b. Write ASP statement to print on the screen the value of the radio button selected when the second form is c. Write ASP code to store value of the selected radio in one cookie called pointfortask1 when the first form is d. Write ASP code to store value of the selected radio in one cookie called pointfortask2 when the second form is e. Write ASP code so that the cookie pointfortask1 remain stored for 7 days. f. Write ASP code so that the cookie pointfortask1 gets deleted. g. Write ASP code to display the value of the selected radio in a text box for any of the form submitted. (Assume that at least one radio is selected.) h. Write ASP code to display the value of the selected radio in a text box for any of the form submitted. However, the text box should not bee seen on the screen. (Assume that at least one radio is selected.) g. Write ASP code to check the radio selections if the user has submitted the second form with Quiz selected. If yes, store 15 in a session variable called Quiz. h. Write an ASP statement to delete the session variable Quiz. 2: Working with Selection for single choices Change the HTML code in practice problem 1 so that the user is able to make a selection of the choices from a list instead of radio buttons and get the same functionality. Complete all the exercises listed in practice problem 1.

3: Working with Checkboxes <html> <head> <title>extracting Highlighted checkboxes</title> <script LANGUAGE="JavaScript">. </script> </head> <body> <form action="asptest.asp" method="post"> <b><p>select the criteria for which you want the points in COMS463:</b></p> <p><input TYPE="checkbox" NAME="coms463" VALUE="Project: 40" CHECKED>Project <input TYPE="checkbox" NAME="coms463" VALUE="Assignment : 10">Assignment <input TYPE="checkbox" NAME="coms463" VALUE="Midterm : 25">Midterm <input TYPE="checkbox" NAME="coms463" VALUE="Final : 25">Final</p> <p><input TYPE="submit" NAME="Viewer" VALUE="View 463 Points..." onclick="return ShowPoints63()"> </p> </form> <form action="asptest.asp" method="post"> <p><br> <b>select the criteria for which you want the points in COMS462:</b></p> <p><input TYPE="checkbox" NAME="coms462" VALUE="Programming : 20">Programming <input TYPE="checkbox" NAME="coms462" VALUE="Lab Works : 25" CHECKED>Lab Works <input TYPE="checkbox" NAME="coms462" VALUE="Quiz : 15">Quiz <input TYPE="checkbox" NAME="coms462" VALUE="Exam1: 20">Exam1 <input TYPE="checkbox" NAME="coms462" VALUE="Final : 20">Final</p> <p><input TYPE="submit" NAME="Viewer" VALUE="View 462 Points..." onclick="return ShowPoints62()"> </p> </form> </body> </html> HTML Question: a. Draw the screen output of the above HTML code. JavaScript Questions: a. Write a JavaScript statement to print out on an alert window the number of checkboxes included in the form that has the group name i. coms463 ii. coms462 b. Write a JavaScript statement to print out as an alert box the value of the first checkbox (whether or not selected) in the first form. (Note that JavaScript uses index 0 for the first Checkbox) c. Write a JavaScript statement to print out as an alert box the value of the third Checkbox (whether or not selected) in the second form. d. Write JavaScript code segment to assign the value of the selected Checkbox in the first form to a variable named allocatedpoint1.

e. Write a JavaScript statement to print the value of allocatedpoint1 on the screen. f. Write JavaScript code segment to assign the value of the selected checkboxes in the second form to a variable named allocatedpoint2. g. Write a JavaScript statement to print the value of allocationpoint2 on the screen. h. Write JavaScript function that will print on the screen the total count of checkboxes selected in the first form. i. Write JavaScript function that will print on the screen values for each of the selected check boxes, one after the other in alert boxes, with the sentence In COMS463 the allocated point for followed by the values of the selected check boxes in the first form. j. Write JavaScript function that will print on the screen values for each of the selected check boxes, one after the other the alert boxes, with the sentence In COMS462 the allocated point for followed by the values of the selected check boxes in the second form. k. Write JavaScript code segment that will print on the screen the total count of the selected check boxes in the first and the second form. ASP Questions: a. Write ASP statement to print on the screen the count of the check boxes selected when the first form is submitted. (Assume that at least one checkbox is selected.) b. Write ASP statement to print on the screen in different lines the values of the check boxes selected when the first form is submitted. (Assume that at least one checkbox is selected.) c. Write ASP statement to print on the screen in different lines the values of the check boxes selected when the second form is submitted. (Assume that at least one checkbox is selected.) d. Write ASP code to store value of all selected check boxes in one cookie called pointfortask1 when the first form is submitted. (Assume that at least one check box is selected.) e. Write ASP code to store value of all selected check boxes in one cookie called pointfortask2 when the second form is submitted. (Assume that at least one check box is selected.) f. Write ASP code so that the cookie pointfortask1 remain stored for 7 days. g. Write ASP code so that the cookie pointfortask1 gets deleted. h. Write ASP code to display the value of the selected check boxes each in one text box when the first form is submitted. (Assume that at least one check box is selected. Note that the number of text boxes will equal to the number of check boxes selected.) i. Write ASP code to display the value of the selected check boxes each in one text box when the second form is submitted. (Assume that at least one check box is selected. Note that the number of text boxes will equal to the number of check boxes selected.) j. Write ASP code to display the value of the selected check boxes each in one text box as in i and j above. However, the text box should not bee seen on the screen. (Assume that at least one radio is selected.) m. Write ASP code to identify if the user has submitted the second form with Quiz selected. If yes, store 15 in a session variable called Quiz. (Assume that at least two of the check boxes is selected.)

h. Write an ASP statement to delete the session variable Quiz. i. Write ASP code to print on the screen the value of the last checkbox selected when the first form is j. Write ASP code to print on the screen the value of the second checkbox selected when the first form is k. Write ASP code to print on the screen the value of the 3rd checkbox selected when the second form is 4: Working with Selection for multiple choices Change the HTML code in practice problem 2 so that the user is able to make a selection of the choices from a list (multiple at a time) instead of radio buttons and get the same functionality. Complete all the exercises listed in practice problem 2. 5: Some More a. Write HTML code to display three text boxes on a screen. In the first text box you may enter a number 1, 2 or 3 followed by space(s) and then any sentence. After clicking on the button the sentence (without the numbers) should be displayed in the appropriate text box (1, 2 or 3) identified by the leading number entered in the first text box. If you identify that the leading number in the given range is missing in the first text box, then an error message is given to follow the specification. i. Write a JavaScript function to achieve the above functionality. ii. Write ASP code to achieve the above functionality. Note: Selected solutions of only few will be posted on the web page on Monday or Tuesday.