In systems that incorporate human-entered content into cryptodb, it is important to match authors to existing records, because names are not sufficiently unique identifiers for authors or committee members. As an example, the authors Nigel Smart and N. Smart and Nigel P. Smart are probably the same person, but a database has a hard time determining this.
For this reason, I now provide an auto-complete system that will automatically match what the user types against existing names in the cryptodb database. An example is shown here:
This is extremely useful to incorporate into any forms, because it automatically looks up the author_id for an IACR author, and this can follow the author record through the entire life cycle so that there is no further ambiguity on the identify of the author.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function() {
// apply autocomplete to the author class
$(".author").autocomplete({
source: "/cryptodb/data/jquery/query.php",
minLength: 2,
scrollHeight: 200,
contentType: "application/json; charset=utf-8",
max: 50,
select: function(event, ui) {
$("#author_id").val(ui.item.id);
}
});
});
</script>
Then put a form containing the following fields:
<input type="text" class="author"> <input type="text" id="author_id">This uses the jquery autocomplete API to request extensions of the string the user types, and fills in the ID corresponding to the author that is selected. It should be pretty obvious how to modify the script to perform other actions rather than setting author_id. If you want to see what data is returned, try http://www.iacr.org/cryptodb/data/jquery/query.php?term=Ivan.