Setting a form value with jQuery

If you want to select form value, for example hidden field for subject in mail form you can set the form values with jQuery using the val() function.

If the form element is <input id="subject" name="subject" type="hidden" value="someweb.com" /> you set it with  $('#subject').val(itemId);

so put it in function

<script type="text/javascript">
 function toggleDescription(itemId) {
 $('#subject').val(itemId);
 window.alert( $('#subject').val() );
 }
</script>