Best way to concatenate two URL parameters into one hidden field

Best way to concatenate two URL parameters into one hidden field

How can I concatenate two URL parameters into one hidden field? For example:

sometestingurl.com?color=yellow&thingy=box

We'd like "yellow-box" to pass in the hidden field, "finalProd".

  1.     $('a[href^="http"]').each(function() {
  2.         var $a = $(this),
  3.             q = $a.attr('href') ? $a.attr('href').indexOf('?') : -1,
  4.             contents = $a.html();
  5.         if (q == -1) {
  6.             $a.attr('href', $a.attr('href') + '?color=' + App.getParameterByName('color') + '&thingy=' + App.getParameterByName('thingy'));
  7.         } else {
  8.             $a.attr('href', $a.attr('href') + '&color=' + App.getParameterByName('color') + '&thingy=' + App.getParameterByName('thingy'));
  9.         }
  10.         $a.html(contents);
  11.     });
  12.     var color = $("#color").attr('value', App.getParameterByName('color'));
  13.     var thingy = $("#thingy").attr('value', App.getParameterByName('thingy'));
  14.     $("#finalProd") = color + '-' + thingy;
Within the form...
  1. <input type="hidden" name="finalProd" id='finalProd' value="">