Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click on Setup

  2. Click Page Extensions

  3. Click the Add button

  4. Enter the following information:
    Name - RequirePackageOnAddAccount
    Page - User/add(to apply the same option to the ticket edit screen this value should be ticket/edit)
    Script - see below, same for both the add and edit screens

    Code Block
    languagejs
    var onClick = jQuery("#SaveButton")[0].onclick = null;
    jQuery("#SaveButton, #SaveNewButton").click(function(){
      if(jQuery("#PackageCount").val()=="0"){
        alert('Please add at least one package');
        return false;
      }
      if (checkvalidation(document.getElementById('EditForm'), 0)) {
        DisableSubmitButtons();
        new Ajax.Updater('overDiv', 'AJAXPrevalidate.rails', {asynchronous:true, evalScripts:true, parameters:Form.serialize(document.getElementById('EditForm'))}); 
        return false;
      } 
      else {
        return false;
      });
  5. Click Save