Food Field Hidden via Jquery

Asked

Viewed 286 times

2

How do I send a value to a Hidden field via Jquery?

I need to send him an array position.

  • It has an id or a name?

  • Yes has id and name

1 answer

3


Just like any other field:

You can pick it up by the id:

$(function(){
    $('#id_campo').val(id_array);
});

By name:

$(function(){
    $("[name='nome_campo']").val(id_array);
});

Or by class:

$(function(){
    $(".classe_campo").val(id_array);
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.