Commit 33212c30 authored by stef's avatar stef

[fix] better advancement to next input, in report form

parent 4918dc4a
......@@ -14,6 +14,7 @@ function init_form() {
var country=$(this).attr('value');
if(country.length>0) {
$('#id_operator').parent().show();
$('#id_operator').focus();
$.getJSON('/ajax/'+country, function(data) {
$("#id_operator").autocomplete(data, { minChars: 0, autoFill: true });
});
......@@ -24,6 +25,7 @@ function init_form() {
var operator=$(this).val();
if(operator.length>0) {
$('#id_contract').parent().show();
$('#id_contract').focus();
$.getJSON('/ajax/'+country+'/'+operator, function(data) {
$("#id_contract").autocomplete(data,{ minChars: 0 });
});
......@@ -44,4 +46,12 @@ function init_form() {
$("#show_optionals").show();
}
});
$("form").bind("keypress", function(e) {
if (e.keyCode == 13) {
e.preventDefault();
$(e.target).change();
return false;
}
return true;
});
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment