Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function swapValues(el1, el2)
- {
- var t = el1.value; el1.value = el2.value; el2.value = t;
- }
- function jumpTo(name)
- {
- var el = document.loginform.elements[name];
- if (el != null && el.value == "") {
- el.focus();
- return true;
- }
- return false;
- }
- function onEnter()
- {
- // if all input fields are filled, submit the form;
- // otherwise jump to a next empty input field
- (typeof jumpToFirstEmptyInputField == "function" &&
- jumpToFirstEmptyInputField()) ||
- (typeof document.loginform == "object" &&
- document.loginform.submit());
- }
- function focusIn(el)
- {
- if (el != null && !el.disabled)
- el.style.backgroundColor = "#FFF09E";
- }
- function focusOut(el)
- {
- if (el != null && !el.disabled)
- el.style.backgroundColor = "";
- }
- function pair(name, value)
- {
- return {'name':name, 'value':value};
- }
- function submit(arr, allow_empty_fields)
- {
- for (var i in arr) {
- var el = arr[i];
- if (document.loginform.elements[el.name] != null)
- document.loginform.elements[el.name].value = el.value;
- }
- if (typeof allow_empty_fields == "undefined" ||
- allow_empty_fields == false)
- return onEnter();
- return document.loginform.submit();
- }
- function submitOkCode(value, allow_empty_fields)
- {
- return submit([pair('~okcode', value)], allow_empty_fields);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement