Chaos-Events und Voranmeldungen
This commit is contained in:
43
public/js/preapplication/preapplication.js
Normal file
43
public/js/preapplication/preapplication.js
Normal file
@@ -0,0 +1,43 @@
|
||||
$(function() {
|
||||
$('select[autocomplete="off"]').each(function() {
|
||||
let selectedValue = $(this).find('option[selected]').val();
|
||||
if (selectedValue) {
|
||||
$(this).val(selectedValue);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function vorantragAbschicken(){
|
||||
|
||||
let data = {};
|
||||
data.event = $('#eventSelect').val();
|
||||
data.passport_type = $('#passport_type').val();
|
||||
data.mail = $('#mail').val();
|
||||
data.first_name = $('#firstname').val();
|
||||
data.last_name = $('#lastname').val();
|
||||
data.location = $('#location').val();
|
||||
|
||||
console.log(data);
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/vorbeantragen/absenden",
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success:function(r){
|
||||
if(r.messageStatus === "success"){
|
||||
$('#mail').val("");
|
||||
$('#firstname').val("");
|
||||
$('#lastname').val("");
|
||||
$('#location').val("");
|
||||
alert(r.errorMessage);
|
||||
} else {
|
||||
alert(r.errorMessage);
|
||||
}
|
||||
},
|
||||
error:function(r, a, e){
|
||||
alert(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user