function getPdlGestiuni() { var params = ''; params += '&fsync_option_filterstock=' + document.getElementById("fsync_option_filterstock_hidden").value; params += '&shop=' + document.getElementById("fsync_shop_hidden").value; params = encodeURI(params); var xhttp; xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { if( this.responseText != '') { document.getElementById("fsync_option_filterstock").innerHTML = this.responseText; } } }; xhttp.open("GET","ajax.php?random=" + Math.random() + "&action=getPdlGestiuni" + params,true); xhttp.send(); } function submitStockOptionForm() { if(validateOption()) { document.getElementById('save-so-btn').classList.remove('btn-green'); document.getElementById('save-so-btn').innerHTML = ''; document.getElementById('stock_option_form').submit(); } }