AKor
AKor

Reputation: 8882

Using a <textarea> to populate a hidden value with jQuery

I have a <textarea> that is outside of a form. This form has a hidden value called uadc which should be filled with the contents in the <textarea> when the form is submitted. How would I pass the value like that?

Upvotes: 1

Views: 360

Answers (1)

Šime Vidas
Šime Vidas

Reputation: 185933

$('#yourForm').submit(function() {
    $('#uadc').val( $('#yourTextarea').val() );
});

Upvotes: 5

Related Questions