Presentation is loading. Please wait.

Presentation is loading. Please wait.

Course work. Layout of the Main Window Achieved by nesting frames as shown below: Frames Welcome page should be home page.

Similar presentations


Presentation on theme: "Course work. Layout of the Main Window Achieved by nesting frames as shown below: Frames Welcome page should be home page."— Presentation transcript:

1 Course work

2 Layout of the Main Window Achieved by nesting frames as shown below: Frames Welcome page should be home page.

3 Book Catalogue Format in a table. Table columns should be Book Title, Author and Price. Book titles should be links to individual book pages. Individual pages would contain the information given on each book, including description. Individual pages should contain a link back to the main catalogue page. Individual pages should open in the main frame. This should done by setting the target of the links to the main frame. E.g. Beginning Java 2: SDK 1.4 Edition

4 Shopping Basket Also to be organized in tabular format, with columns for Book title, Price, Checkbox for selection, Quantity required (3rd year). You would need to pass in information from this page to the dynamically generated Invoice page. Hence, nest the table cells with form textboxes to facilitate this: Title Price Select Quantity

5 This would enable you to access the values of the different elements. Generating the Invoice page This needs to be dynamically created with the document.open( ) method, that would be invoked by a suitably labelled submit button on the previous page. Subsequently use the document.write( ) and document.writeln( ) methods to generate the content.

6 It may be more convenient to create the code for the Invoice page, and then work backwards to use the document.write( ) method to create desired tags. You can access content of the shopping basket using the object model of the page, e.g. to access the price of the Java SDK book, you would declare a variable, and assign it to document.f1.Price1.value. Submitting the Invoice Form The form should be submitted using either method, PHP, or CGI script.

7 Form Validation There are 2 ways: Either using an array method, in which you create an array of all the textboxes, and validate their content. or Validate the textboxes individually. You can use an if statement to carry this out. E.g. var a=document.f2.student_number.value; var b=document.f2.first_name.value; if ( a= = || b= = ){ alert(You have left a required field blank); elsif ( length(c) >7){ alert(The postcode can not be longer than 7 characters);


Download ppt "Course work. Layout of the Main Window Achieved by nesting frames as shown below: Frames Welcome page should be home page."

Similar presentations


Ads by Google