On 15/11/2007, at 3:34 PM, Casey Farrell wrote:

Try using single quotes, as in:

<select name="category" onchange="showSubcategory (document.getElementById('category').value)">
Michael Horowitz wrote:

Even better would be to modify the function itself to get the second value:

<select name="category" id="categoryselect">

Then in the JS:

function showSubcategory(value1) {
        // Get value 2 either with
var value2 = document.getElementById('secondelement').value; // For input boxes
        // or
        var secondSelect = document.getElementById('secondelement');
var value2 = secondSelect.items [secondSelect.selectedIndex].value; // For select menus

        ...do something

window.onload = function() {
        document.getElementById('categoryselect').onchange = showSubcategory;

Where 'secondelement' is the ID of your second element.

List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm

Reply via email to