Question: Part 1: Using an XML Schema You will find an XML Schema for a simple tool catalog here: http://weblab.kennesaw.edu/toolschema.xsd Read the schema to find out

Part 1: Using an XML Schema You will find an XML Schema for a simple tool catalog here: http://weblab.kennesaw.edu/toolschema.xsd Read the schema to find out what XML elements are expected and what they contain. (Hint: The comments are your friend. If you've forgotten what the URLs for the tool pictures look like, they are lab 2.

Write an XML file containing information for at least three types of tools. To get you started, I've done the hard part:

       

Place your XML file on the server as l6p1.xml. Put a link to your XML file on your index page.

To validate your XML, navigate to this address: https://devutilsonline.com/xml/validate Paste the URL of your XML file in the left-hand box, which is labeled XML URL. Paste a link to the XSD file: http://weblab.kennesaw.edu/toolschema.xsd into the right-hand box, labeled XSD URL. Then click the "Validate XML" button at the bottom left. Correct any errors the validator finds.

Part 2; Validating form data: Make a copy of the order form from lab exercise 4 and name it l6p2.php. Remove the JavaScript code to calculate the total price. If you used anything other than a plain text box for quantities, change the quantity inputs to type="text". (The goal of this part of the assignment is for you to use regular expressions to validate text.)

Add JavaScript code to produce an error message and suppress submission of the form if any quantity field contains non-numeric data. (It's OK for a quantity to be empty, but if it's non-empty, it must have only numbers.) Add an action= attribute to your

tag to submit the form to http://weblab.kennesaw.edu/formtest.php. Test that the form is submitted correctly when the quantities are numeric or empty, and that an error message is produced otherwise. (Regular expressions are your friend. Anything that's not a digit is bad. What is the predefined class for non-digits?)

Add to your index page a link to your new order form.

As with the previous assignment, the goal is to learn to validate with JavaScript. The use of an input element with type "number" or anything similar will earn a zero on this part of the assignment. You must use JavaScript for the validation.

Part 3; Using PHP to generate forms: To your order form from Part 2, add input elements for customer name and address if they're not already there. The "state" part of the address must be a select element(also called a "pulldown menu") to allow the person placing the order to choose his or her state. Don't type all fifty states, but supply at least Georgia, Alabama and Florida. Put the names of the states in an PHP array and use PHP code to create the drop-down dynamically. (This will still be named l6p2.php; you're just adding to something you've already tested.)

You will find an example of creating a select element for states in the class slides covering HTML forms. You are going to create the drop-down dynamically, and not by hard-coding it. This part of the assignment is a fair example of something you might do with PHP in "real life." Instead of an array, you would use a database call, so if we suddenly add another state to the U.S. (or your company suddenly adds another state to its service area) a change to the database automatically (and immediately) changes what people see in the form. For this assignment, you're loading states from an array. We'll get them from a database in the next assignment.

You do not need a special link on your index page for Part 3; I will test Part 3 at the same time I test Part 2.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!