<filedset type="buildyouform">
<script type="text/javascript">
$(function() {
$("#ref").combobox({
minLengthToAutocomplete : 2,
selected : function(event,ui) {
var obj = [];
$.each(obj, function(key,values) {
if (values.method.length) {
getMethod(values);
}
});
}
});
function getMethod(obj) {
var id = $("#ref").val();
var method = obj.method;
var url = obj.url;
var htmlname = obj.htmlname;
$.getJSON(url,
{
action: method,
id: id,
htmlname: htmlname
},
function(response) {
$.each(obj.params, function(key,action) {
if (key.length) {
var num = response.num;
if (num > 0) {
$("#" + key).removeAttr(action);
} else {
$("#" + key).attr(action, action);
}
}
});
$("select#" + htmlname).html(response.value);
});
}
});</script>
<select id="ref" class="flat" name="ref" style="display: none;">
<option value="-1"></option>
<option value="1337">10040 - HKV 48 Vorderschirm ART_000046 10040</option>
// тут ещё до хрена строчек
<option value="2409">10111067 - HWZ M-NRK Qn10 30° 100l/i BR 423 ART_001118 10111067</option>
</select><input class="ui-autocomplete-input ui-widget ui-widget-content ui-corner-left dolibarrcombobox" autocomplete="off">
<button type="button" tabindex="-1" title="Show All Items" class="ui-button ui-widget ui-state-default ui-button-icon-only ui-corner-right ui-button-icon" role="button" aria-disabled="false">
<span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"></span>
<span class="ui-button-text"> </span></button>
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
/
<input type="text" id="stok" name="stok" size="10" value="">
</filedset>
<input type="button" value="Weterer Artikel" class="add" id="add">