Skip to content

Commit

Permalink
allow entry of object IDs as per stock item relations behaviour, on t…
Browse files Browse the repository at this point in the history
…op of the new autocomplete functionality
  • Loading branch information
Thom Mc committed Apr 29, 2015
1 parent a92af28 commit d9b4c98
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions item_relations_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@
}
})
}
});
});
}).keyup(function() { // preserve plain numeric input if desired
var searchfield = jQuery("#item_relations_item_relation_object_item_search" + rowid);
if (searchfield.val() && !isNaN(searchfield.val())) {
var id_value = searchfield.val();
jQuery('input[id=item_relations_item_relation_object_item_id'+ rowid + ']').val(id_value);
}
})
})
});
});

Expand All @@ -121,6 +127,12 @@
}
})
}
}).keyup(function() { // preserve plain numeric input if desired
var searchfield = jQuery("#item_relations_item_relation_object_item_search0");
if (searchfield.val() && !isNaN(searchfield.val())) {
var id_value = searchfield.val();
jQuery('input[id=item_relations_item_relation_object_item_id0]').val(id_value);
}
});
});
</script>

0 comments on commit d9b4c98

Please sign in to comment.