Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function(){
- $("[name=type_id]").on("change", function(){
- var typeId = $(this).val();
- $.get('${ contextPath }/api/v1/attributes?type_id=' + typeId, function (response) {
- console.dir(response);
- for (var i = 0 ; i < response.length; i++) {
- console.log(response[i]);
- $(".attributes").add( "label" ).addClass( "col-attribute col-sm-2 control-label" );
- $(".attributes").add( "div" ).addClass( "col-sm-8" );
- $(".attributes").add( "input" )
- .addClass("form-control")
- .attr("name","response[i].name")
- .attr("id","response[i].id}");
- }
- })
- .fail(function () {
- })
- .always(function () {
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement