mercredi 5 août 2015

Value of submitted input is empty


I want to submit some data which I attach to an input element. The server get's this element, with correct ID, but it has no value.

<form id="sub_form" method="post" action="acc_manage.lp"> 
    <input type="text" name="container" id="sub_inp" value=""> </input>
</form>

sub_inp receives its input from a specific event, which calls:

function execute_submit(){
    $("#sub_inp").val(JSON.stringify(foo));
    // .val() returns a stringified object 
    console.log( $("#sub_inp").val() )
    if ($("#sub_inp").val() != "") {
        $("#sub_form").submit();
  };

Value of the post request on server-side is this:

post={ container={} }, formdata={}, errtag={} }

Why is this and how can I fix it? I am using jQuery 2.1.3



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire