javascript - Text input from jquery not working -
hi have script appends set of constant string textarea
works fine if click button first input text on textarea, button not append constant string on textarea if clicked again
here code click event:
$("#apply").on("click",function() { var orange = $("#agent_option").val(), lock = $("#agent_disallowed").val(); $("#textareafixed").html(orange + " " + lock ); });
and here html form:
<label for="agent_option" class="control-label">user-agent :</label></div> <div class="col-md-6"> <select id="agent_option" class="form-control input-sm"> <option value="all">all</option> <option value="banana">banana</option> <option value="apple">apple</option> <option value="melon">melon</option> <option value="lynx">lynx</option> <option value="liger">liger</option> </select> </div> <div class="row"> <div class="col-md-4"> <label for="ax_disallowed" class="control-label">disallow :</label></div> <div class="col-md-6"> <input class="form-control input-sm" id="ax_disallowed" type="text" value="<?=ax_default_disallow;?>"> </div> </div> <div class="row"> <div class="col-md-4"> <button id="apply" class="btn btn-default">register player</button> </div>
this textarea:
<form method="post" class="form-login"> <div class="form-group"> <textarea name="new_config" class="form-control" id="textareafixed" cols="60" rows="16"><?=file_get_contents($open); ?></textarea> </div> </form>
please me tried google found irrelevant results. guys hope :(
change .html(...)
.val(...)
$("#apply").on("click",function() { var orange = $("#agent_option").val(), lock = $("#ax_disallowed").val(); $("#textareafixed").val(orange + " " + lock ); });
Comments
Post a Comment