So I have the following code (simplified for the sake of posting here):

        $(function() {
            $('#sector1').change(function() {
                var x = $(this).val();
                $('#spanID').text("" + (x));
    <form action="" method="post">
    <select multiple="" id="sector1">
    <option value="S01">S01</option>
    <option value="S02">S02</option>
    <option value="S03">S03</option>
    <option value="S04">S04</option>
    <span id="spanID">x</span>
This works perfectly. The content within the span updates on the fly with the values of the multiselect.

What I need to do however is update a variable within an onclick:

    <input type="submit" onClick="_gaq.push(['_trackEvent', 'Request Info', 'Enquiry Submit', '{VARIABLE}']);" />
Any ideas would be much appreciated.