Opus,

>I have a form that I'm building in Drupal, that takes user input and
>crafts a support request email. I'm using a drop down box to list
>types of software that a client would need support with. I'd like to
>pull the result of the select and put it into a hidden text field so I
>can tailor the subject line of the email so that all emails to our
>support center don't all look the same.

The Form Plug-in has a method called fieldValue() which you can you to grab
the value of the select element in an array. You can then use the val()
method to set the value of the hidden form field.

Form Plug-in
http://www.malsup.com/jquery/form/

val()
http://docs.jquery.com/DOM/Attributes#val.28_val_.29

Example:
var oSelectVal = $("select").fieldValue();
$("input:hidden").val(oSelectVal.join(","));

Then there's also the Field Plug-in I'm working on:
http://pengoworks.com/workshop/jquery/field.plugin.htm

Example:
$("input:hidden").setValue( $("select").getValue() );

-Dan

Reply via email to