function WorkflowRedirect(Control) { var ControlId = Control.value; // Added by Vadim Shumilov 02/21/2014 if (Control.name == 'btnNewOrder') ControlId = 'New Order/Quote'; if (Control.name == 'btnBack') ControlId = '< BACK'; // ------------------------------------ switch (ControlId) { case 'Order': $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); break; case 'Quote': $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); break; case 'New Order/Quote': $('#divOptions').removeClass('visible').addClass('invisible'); $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divInformation').removeClass('invisible').addClass('visible'); break; case 'Re-Order/Quote': document.getElementById('goLocation').href = baseUrl() + 'Application/Pages/Others/ReOrder.aspx'; document.getElementById('goLocation').click(); break; case 'Upload a File': document.getElementById('goLocation').href = baseUrl() + 'Application/Pages/Others/AttachFile.aspx'; document.getElementById('goLocation').click(); break; case 'Resume Progress': document.getElementById('goLocation').href = baseUrl() + 'Application/Pages/Others/Resume.aspx'; alert($('#goLocation')); $('#goLocation')[0].click(); break; case 'NEXT >': document.getElementById('goLocation').href = baseUrl() + 'Application/Pages/ProductInformation/ProductFamily.aspx'; //window.location.href = document.getElementById('goLocation').href ; document.getElementById('goLocation').click(); break; case '< BACK': if ($('#divOptions')[0].className.indexOf('invisible') > -1) { $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); } else { $('#divQuoteOrOrder').removeClass('invisible').addClass('visible'); $('#divOptions').removeClass('visible').addClass('invisible'); $('#divInformation').removeClass('visible').addClass('invisible'); } break; } return false; } function MobWorkflowRedirect(Control) { var ControlId = Control.value; // Ch001 Start -- Getting the button text to hide the respective div's if (Control.name == 'Button2') ControlId = Control.title; if (Control.name == 'btnNext') ControlId = Control.title; if (Control.name == 'btnBack') ControlId = Control.title; // Ch001 End // Added by Vadim Shumilov 02/21/2014 if (Control.name == 'btnNewOrder') ControlId = 'New Order/Quote'; if (Control.name == 'btnBack') ControlId = '< BACK'; // ------------------------------------ switch (ControlId) { case 'Order': $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); break; case 'Quote': $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); break; case 'New Order/Quote': $('#divOptions').removeClass('visible').addClass('invisible'); $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divInformation').removeClass('invisible').addClass('visible'); break; case 'Re-Order/Quote': window.location.href = baseUrl() + 'Application/Pages/MobOthers/ReOrder.aspx'; break; case 'Resume Progress': window.location.href = baseUrl() + 'Application/Pages/MobOthers/Resume.aspx'; break; case 'NEXT >': window.location.href = baseUrl() + 'Application/Pages/MobPrdInfo/ProductFamily.aspx'; break; case '< BACK': if ($('#divOptions')[0].className.indexOf('invisible') > -1) { $('#divQuoteOrOrder').removeClass('visible').addClass('invisible'); $('#divOptions').removeClass('invisible').addClass('visible'); $('#divInformation').removeClass('visible').addClass('invisible'); } else { $('#divQuoteOrOrder').removeClass('invisible').addClass('visible'); $('#divOptions').removeClass('visible').addClass('invisible'); $('#divInformation').removeClass('visible').addClass('invisible'); } break; } return false; } function baseUrl() { var href = window.location.href.split('/'); if (href[3] != 'Application' && href[3] != 'application') { return href[0] + '//' + href[2] + '/' + href[3] + '/'; } else { return href[0] + '//' + href[2] + '/'; } } function NumericOnly(e) { if (window.event) // IE { if ((e.keyCode < 48 || e.keyCode > 57) & e.keyCode != 8) { event.returnValue = false; return false; } } else { // Fire Fox if ((e.which < 48 || e.which > 57) & e.which != 8) { e.preventDefault(); return false; } } } function allowNegativeDecimalNumber(e) { var charCode = (e.which) ? e.which : event.keyCode if (charCode > 31 && (charCode < 45 || charCode > 57)) { return false; } return true; } function FloatingPointOnly(e, sender) { var str = sender.value; if (window.event) // IE { var keyCode = (event.which) ? event.which : (window.event.keyCode) ? window.event.keyCode : -1; window.event.returnValue = false; // if ((str.length == 0) && (event.keyCode == 46)) { // window.event.returnValue = false; // return; // } if ((str.indexOf('.') >= 0) && (event.keyCode == 46)) { window.event.returnValue = false; return; } else if ((str.length > 0) && (str.indexOf('.') >= 0) && (str.indexOf('.') == (str.length - 4))) { window.event.returnValue = false; return; } else if ((keyCode > 47 && keyCode < 58) || keyCode == 46) { window.event.returnValue = true; } } else { // if ((str.length == 0) && (e.which == 46)) { // e.preventDefault(); // return; // } if ((str.indexOf('.') >= 0) && (e.which == 46)) { e.preventDefault(); return; } else if ((str.length > 0) && (str.indexOf('.') >= 0) && (str.indexOf('.') == (str.length - 4)) && e.which != 8 && e.which != 46) { e.preventDefault(); return; } if ((e.which < 48 || e.which > 57) && e.which != 46 && e.which != 8 && e.keyCode != 9) { e.preventDefault(); return false; } } } function ValidFloatingPoint(e, sender) { if (sender.value.length > 0 && sender.value.indexOf('.') == (sender.value.length - 1) || (sender.value.length == 1 && sender.value == '-')) { alert("Please enter valid input"); sender.value = ""; sender.focus(); } } function ValidateCustomerControls() { var txtCusFirstNameObj = document.getElementById('txtCusFirstName'); var txtCusLastNameObj = document.getElementById('txtCusLastName'); var txtCusEAddressObj = document.getElementById('txtCusEAddress'); var btnCusSubmitObj = document.getElementById('btnCusSubmit'); var mdlpopupObj = $find('mdlpopupValidation'); if (btnCusSubmitObj != null) { if (txtCusFirstNameObj != null && txtCusLastNameObj != null && txtCusEAddressObj != null) { var email = txtCusEAddressObj.value; if (ValidateName(txtCusFirstNameObj) && ValidateName(txtCusLastNameObj) && ValidateEmail(txtCusEAddressObj)) { btnCusSubmitObj.disabled = false; } else if (lblObj != null && btnOkObj != null) { btnCusSubmitObj.disabled = true; $find('mdlpopupValidation').show(); //$find('mdlpopupObj').show(); } } } } function ShowValidationPopup() { var lblObj = document.getElementById('lblValdtn'); var btnOkObj = document.getElementById('btnOk'); } function ValidateName(txtNameObj) { var namePtn = /^[a-zA-Z0-9]+$/; var nameVal = txtNameObj.value; if (namePtn.test(nameVal) && nameVal != "") { return true; } else { return false; } } function ValidateEmail(txtEmailObj) { var emailPtn = /^[a-zA-Z0-9]+(\.){0,1}(-){0,1}(_){0,1}[a-zA-Z0-9]+(@){1}[a-zA-Z]+(\.){1}[a-zA-Z]{2,3}((\.){1}[a-zA-Z]{2}){0,1}$/; var emailVal = txtEmailObj.value; if (emailPtn.test(emailVal) && emailVal != "") { return true; } else { return false; } } function checkEmail(inputvalue) { var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/; if (pattern.test(inputvalue)) { return true; } else { return false; } } function DoNotAllowZero(sender) { if (sender.value.length > 0) { if (Number(sender.value) <= 0) { alert('Please enter value greater than zero'); sender.value = ""; } } } function FloatingPointWithMinus(e, sender) { var str = sender.value; if (window.event) // IE { var keyCode = (event.which) ? event.which : (window.event.keyCode) ? window.event.keyCode : -1; window.event.returnValue = false; if ((str.length == 0) && (event.keyCode == 46)) { window.event.returnValue = false; return; } else if ((str.indexOf('.') >= 0) && (event.keyCode == 46)) { window.event.returnValue = false; return; } else if ((str.length != 0) && (event.keyCode == 45)) { window.event.returnValue = false; return; } else if ((str.length > 0) && (str.indexOf('.') >= 0) && (str.indexOf('.') == (str.length - 4))) { window.event.returnValue = false; return; } else if ((keyCode > 47 && keyCode < 58) || keyCode == 46 || keyCode == 45) { window.event.returnValue = true; } } else { if ((str.length == 0) && (e.which == 46)) { e.preventDefault(); return; } else if ((str.indexOf('.') >= 0) && (e.which == 46)) { e.preventDefault(); return; } else if ((str.length != 0) && (e.which == 45)) { e.preventDefault(); return; } else if ((str.length > 0) && (str.indexOf('.') >= 0) && (str.indexOf('.') == (str.length - 4)) && e.which != 8 && e.which != 46) { e.preventDefault(); return; } if ((e.which < 48 || e.which > 57) && e.which != 46 && e.which != 8 && e.which != 45) { e.preventDefault(); return false; } } }