1 November Building an Interactive Web Page
Presentations Casey: Current event A J: Education Cherrelle: Advertising
Caveat There are lots of differences between browsers What I’m going to describe works for HTML 4 on Mozilla No guarantees on other browsers That’s why some pages don’t work on Mozilla but only Internet Explorer
Recognizing events in forms Primary one: onclick Others: onfocus, onmouseover, … Attribute within an tag The command that is in that field is executed when the button is clicked on
If the action uses a variable Needs to be none everywhere Define it in Define here
Or action can be function Just like a mathematical function Executes its description Place it in the head section, surrounded by … Need to indicate that you’re using javascript
Learning by Example onclick="buy_latte(this.form)“ Function is buy_latte Pass it a value to work with in () Will always be “this.form” Passes all of the values that you have identified in your form
Inside the function Value passed is called the parameter We’ll always call the value form function buy_latte(form) { form.result.value = "latte"; form.price.value = 1; } Always set a variable by referring to it as form.input-value-name.value
Let’s look at an example
Wednesday Gary Bishop, Computer Science Department Assistive Technology Technology available to help people with disabilities But VERY expensive Goal: to build low-cost assistive technologies