Is there a way to gather multiple input field values when the final input field has been selected?

Here's an example:

HTML Code:
Qty: <select name="qty">
       <option value="5">5</option>
       <option value="10">10</option>
Color: <select name="color">
         <option value="red">red</option>
         <option value="blue">blue</option>
Size: <select name="size" onselect="ajaxScript(this.value)">
        <option value="medium">medium</option>
        <option value="large">large</option>
So in other words, when someone selects the size, the variables for qty, color and size are all sent to the ajaxScript. Is this possible?