Skip to content
Snippets Groups Projects
Commit 7e17ef78 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

custom amount focusses input when clicked

parent c2e98fd7
No related branches found
No related tags found
2 merge requests!1895Development,!1786Development
function bitpayCheckRequiredFields(form) {
var elements = form.elements;
var invalid = false;
for (var i = 0; i < elements.length; i++) {
elements[i].className = elements[i].className.replace('bitpay-donate-error', '');
if (elements[i].className.indexOf("required") !== -1 && elements[i].value.length < 1) {
elements[i].className = elements[i].className + ' bitpay-donate-error';
invalid = true;
};
}
if (invalid) {
return false;
}
var donationElement = document.getElementById('donation-value');
if (donationElement) {
var enteredDonation = Number(donationElement.value);
var maximumDonation = Number(document.getElementById('reference-maximum').value);
if (enteredDonation > maximumDonation) {
alert("Your donation was larger than the allowed maximum of " + Number(maximumDonation).toFixed(2))
return false;
};
};
return true;
};
\ No newline at end of file
$(document).ready(function () {
$(".amount-custom").click(function () {
setTimeout(function () {
$("#custom-amount").focus();
}, 100)
});
});
\ No newline at end of file
......@@ -62,6 +62,11 @@
<link type="text/css" rel="stylesheet" href="{{ mix('css/fontawesome-solid.css') }}" />
<script src="{{ mix('js/lib.js') }}"></script>
<script src="{{ mix('js/utility.js') }}"></script>
@if(!empty($js) && is_array($js))
@foreach($js as $jsFile)
<script src="{{$jsFile}}" async></script>
@endforeach
@endif
</head>
<body>
@if(Request::getHttpHost() === "metager3.de")
......
......@@ -73,6 +73,7 @@ Route::group(
Route::get('spende', function () {
return view('spende.spende')
->with('title', trans('titles.spende'))
->with('js', [mix('/js/donation.js')])
->with('navbarFocus', 'foerdern');
});
Route::get('spende/danke/{data}', ['as' => 'danke', function ($data) {
......
......@@ -78,7 +78,7 @@ mix
"public/js/scriptResultPage.js"
)
.babel("resources/js/editLanguage.js", "public/js/editLanguage.js")
.babel("resources/js/bitpay.js", "public/js/bitpay.js")
.babel("resources/js/donation.js", "public/js/donation.js")
// utility
.babel(
["resources/js/utility.js", "resources/js/translations.js"],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment