2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-27 09:41:55 +00:00
troggle/media/js/QM_helper.js
substantialnoninfringinguser b816463d1d [svn] * Adding JS fill in next QM number via ajax.
* Slight models cleanup- get rid of TroggleImageModel class, use mixin instead.
* Collect various troggle shared functions into utils.py
2009-07-04 08:27:49 +01:00

20 lines
493 B
JavaScript

$(document).ready(function(){
$('.number:first').append("<a href='javascript:void(0)' class='next_qm_link'>get next number</a>");
new_qm_link=function(e){
if ($('#id_cave:first')[0].value != "")
{
$.post('/newqmnumber/',{'cave':$('#id_cave')[0].value,'year':$('#id_expedition')[0].value}, function(data){
$('#id_QMs_found-0-number')[0].value=data;
});
}
else {
alert('Please choose a cave and try again.')
};
};
$('.next_qm_link').bind("click", new_qm_link);
});