I think you may have something with this secondSelect.items as I am using a select menu. Can you explain where I would put my variable names in here please.

Thanks

Michael Horowitz
Your Computer Consultant
http://yourcomputerconsultant.com
561-394-9079



Kit Grose wrote:
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
Help: [EMAIL PROTECTED]
*******************************************************************




*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to