Javascript/html onChange multiple parms issue

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
hepworthd
Forum Newbie
Posts: 4
Joined: Wed Feb 23, 2011 9:45 am

Javascript/html onChange multiple parms issue

Post by hepworthd »

Has anyone had trouble passing multiple select values in to a javascript function? I have a function that takes 4 parms, when I run the function in the window.onload, it works just fine. When I'm trying to run the same function in an onChange, I can only get it to work with one parm.

<select name="Name" id="Name" onchange="listSelects('Name='+document.getElementById('Name').value, 'Name2='+document.getElementById('Name2').value, 'Name3='+document.getElementById('Name3').value, 'Name4='+document.getElementById('Name4').value)">

I may be doing this completely incorrect, but am trying to learn. If I run it as:
<select name="Name" id="Name" onchange="listSelects('Name='+document.getElementById('Name').value)">
it works just fine, but I need the other 3 values passed.

The javascript function is in an external .js file, which calls .php files etc.

I have been searching online with no luck, any help would be greatly appreciated.
hepworthd
Forum Newbie
Posts: 4
Joined: Wed Feb 23, 2011 9:45 am

Re: Javascript/html onChange multiple parms issue

Post by hepworthd »

Oh, as a note, my logic works in IE, but does not work in FireFox.
Post Reply