function SubmitButtonLite(mSubmitButton, mValidation, mDisable, mButtonText, mButtonColor, mButtonBGcolor){ /* ************************************************************************************************* ************************************************************************************************* ***** formSubmit function: This function changes the submit button on the form and can re- ***** ***** store the value if submission fails. ***** ***** ***** ***** parameters ***** ***** ¯¯¯¯¯¯¯¯¯¯ ***** ***** mSubmitButton Holds the object reference to the passed submit button. ***** ***** ***** ***** mValidation Tells the module to call the validation module validateForm() ***** ***** This module calls validation function as validateForm(thisform). ***** ***** If you are using a different name, then do not use this method. ***** ***** Instead, use the mReset method. Should be null if not using. ***** ***** ***** ***** mDisable Disables the submit button - default is false (enabled) ***** ***** ***** ***** mButtonText The text that is displayed during validation and/or submission ***** ***** ***** ***** mButtonColor The color of the mButtonText ***** ***** ***** ***** mButtonBGcolor The button background color ***** ***** ***** ************************************************************************************************* ************************************************************************************************* */ var mSubmitButtonOrgValue; var mSubmitButtonOrgBackgroundColor; var mSubmitButtonOrgColor; var mReset = false; // ***** Set function defaults if not supplied if (typeof(mDisable) != "boolean"){mDisable = true} if (typeof(mValidation) != "boolean"){mValidation = true} // ***** Disable submit button if browser supports it and parameter mDisable is true if (mDisable && (document.all || document.getElementById)){ mSubmitButton.disabled = true; } //alert("mSubmitButton = "+mSubmitButton+"; mValidation =" + mValidation + "; mDisable = " + mDisable + "; mButtonText = " + mButtonText + "; mButtonColor = " + mButtonColor + "; mButtonBGcolor = " + mButtonBGcolor); // ***** This section changes the button message and color. // ***** If these parameters are not passed, then the defaults are used ('Sending...', White text on Black background) mSubmitButtonOrgValue = mSubmitButton.value mSubmitButtonOrgBackgroundColor = mSubmitButton.style.backgroundColor mSubmitButtonOrgColor = mSubmitButton.style.color mSubmitButton.value = (mButtonText != null && mButtonText !== "")?mButtonText:"Sending..." mSubmitButton.style.color = (mButtonColor != null && mButtonColor !== "")?mButtonColor:"#FFFFFF" mSubmitButton.style.backgroundColor = (mButtonBGcolor != null && mButtonBGcolor !== "")?mButtonBGcolor:"#000000" if (mValidation){ if (validateForm(document.survey)){ mSubmitButton.form.submit(); mReset = false; }else { mReset = true; } }else{ mSubmitButton.form.submit(); mReset = false; } // ***** Reset to button if(mReset){ mSubmitButton.value = mSubmitButtonOrgValue mSubmitButton.style.color = mSubmitButtonOrgColor mSubmitButton.style.backgroundColor = mSubmitButtonOrgBackgroundColor if (document.all || document.getElementById){ mSubmitButton.disabled = false; } return false } return false }