开发者

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

开发者 https://www.devze.com 2023-02-14 23:39 出处:网络
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 p

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 th开发者_开发技巧e value like that?


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

精彩评论

暂无评论...
验证码 换一张
取 消