|
Webteacher Software now offers
onChange EventsCertain types of form objects, such as checkboxes and menus can't have a text cursor, so they can't trigger an onBlur event when you make changes. You can use the onChange event to trigger your functions when the user has make his/her selec tion on these items.
Since Netscape forgot to provide a function for getting the value of a select box, I wrote one which I place in the <SCRIPT> tags of any page that has a selection list. Simply copy the getSelect(s) function into your <SCRIPT> area, and getSelect(form.mylist) will return the Value of the current mylist selection. In this example we used the word this as a shortcut. We could have said getSelect(form.list), however since the command was inside the <SELECT> tag, the word this automatically referred to the current <SELECT> object. In this example, if Lycos was selected, then the event onChange="location=getSelect(this)" would be interpreted as location="http://www.lycos.com". Check BoxesSince a checkbox is selected/deselected with a mouse click, the onClick event will trigger your function whenever the checkbox is changed. Each checkbox has a property called checked which is equal to true or false depending on whether the box is currently checked. This example runs a function when the box is clicked, and displays a message if the box is checked.
| |||||||
Home | WebData - Web Database Software | Javascript | CGI | Consulting | Map Builder | Contact Us | The Press Room |