$(function(){
var values = new Array();
$(document).on('click', '.addButton', function(){
var selecField = $('.form-group-multiple-selectsp .input-group-multiple-selectp:last-child select');
var selectsLength =selecField.parent().parent().find('.input-group-multiple-selectp select').length;
var optionsLength = (selecField.find('optionp').length)-1;
if(selectsLength < optionsLength){
var sInputGroupHtml = selecField.parent().html();
var sInputGroupClasses = selecField.parent().attr('class');
selecField.parent().parent().append('<div class="'+sInputGroupClasses+'">'+sInputGroupHtml+'</div>');
var textfield = $('div.form-group-optionsp div.input-group-optionp:last-child input');
var sInputGroupHtml = textfield.parent().html();
var sInputGroupClasses = textfield.parent().attr('class');
textfield.parent().parent().append('<div class="'+sInputGroupClasses+'">'+sInputGroupHtml+'</div>');
}
updateValues($(this).parent().parent());
});