]> git.mxchange.org Git - mailer.git/blobdiff - templates/de/html/js/js_surfbar_member_book.tpl
Fixes for JavaScript in member booking with set limit
[mailer.git] / templates / de / html / js / js_surfbar_member_book.tpl
index 7f742fc7834f05fd30992804d0b5ec9c1b4377c9..c6fa3c746622cdcf40492ad8ad2d4865a51f4358 100644 (file)
@@ -1,18 +1,23 @@
-var limit = document.getElementById('limit');
-var span = document.getElementById('span_limit');
-var old_limit = 0;
+var limit       = document.getElementById('limit');
+var span        = document.getElementById('span_limit');
+var limited_no  = document.getElementById('limited_no');
+var limited_yes = document.getElementById('limited_yes');
 
-function FocusLimitedNo () {
+var old_limit   = 0;
+
+function focusLimitedNo () {
        if ((limit.value > 0) && (limit.value != '-')) {
                old_limit = limit.value;
        }
+       limited_no.focus();
+       limited_yes.blur();
        limit.disabled = true;
        limit.setAttribute('class', 'disabled');
-       limit.style.textAlign = 'center';
        limit.value = '-';
+       return true;
 }
 
-function FocusLimitedYes () {
+function focusLimitedYes () {
        limit.disabled = false;
        limit.setAttribute('class', 'form_field');
        limit.style.textAlign = 'left';
@@ -22,19 +27,44 @@ function FocusLimitedYes () {
                limit.value = '';
        }
        limit.focus();
+       return true;
+}
+
+function changeLimited () {
+       if ((limit.value == '') || (limit.value == 0)) {
+               focusLimitedNo();
+       }
+       return true;
+}
+
+function focusLimit () {
+       limited_yes.focus();
+       limited_no.blur();
+       limit.focus();
+       if (limit.value == '-') {
+               limit.value = '';
+       }
+       return true;
+}
+
+function blurLimit () {
+       if ((limit.value == '') || (limit.value == 0)) {
+               limit.value = '-';
+       }
+       return true;
 }
 
-function SubmitForm () {
+function submitForm () {
        if (limit.value == '-') {
                limit.value = 0;
        }
        return true;
 }
 
-function ResetForm () {
+function resetForm () {
        old_limit = 0;
-       FocusLimitedNo();
+       focusLimitedNo();
        return true;
 }
 
-FocusLimitedNo();
+focusLimitedNo();