Advertisement
Guest User

validation error

a guest
Apr 23rd, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (!this.isProperties) {
  2.  
  3.             // Set the validators for the create/update property form
  4.             this.instructionPropertyForm = this.fb.group({
  5.                 access_type: [this.accessType, Validators.required],
  6.                 address_1: ["", Validators.required],
  7.                 address_2: [""],
  8.                 town: ["", Validators.required],
  9.                 county: [""],
  10.                 postcode: ["", [Validators.required, Validators.pattern(/^(GIR 0AA)|((([A-Z][0-9][0-9]?)|(([A-Z][A-HJ-Y][0-9][0-9]?)|(([A-Z][0-9][A-Z])|([A-Z][A-HJ-Y][0-9]?[A-Z])))) [0-9][A-Z]{2})$/)]],
  11.                 // capscan_uprn: [""],
  12.                 // landmark_uprn: [""],
  13.                 longitude: [""],
  14.                 latitude: [""],
  15.                 key_collect: [""],
  16.                 spos: [""],
  17.                 keysafe_code: [""],
  18.                 key_collect_address_1: [""],
  19.                 key_collect_address_2: [""],
  20.                 key_collect_postcode: [""],
  21.                 access_gained_type: [""],
  22.                 occupied: [""],
  23.                 tenant_contact_name: [""],
  24.                 tenant_contact_phone: [""],
  25.                 tenant_contact_mobile: [""],
  26.                 tenant_contact_email: [""],
  27.                 tenant_contactable: [""],
  28.                 boiler_location: [""],
  29.                 electric_meter_location: [""],
  30.                 water_meter_location: [""],
  31.                 gas_meter_location: [""],
  32.                 pets: [""],
  33.                 loft_access: [""],
  34.                 floor_area: [""],
  35.                 number_of_bedrooms: ["", Validators.required],
  36.                 property_type_id: ["", Validators.required],
  37.                 total_rooms: [""],
  38.                 property_status: ["", Validators.required],
  39.                 customer_type_id: ["", Validators.required],
  40.                 vibrant_notes: [""],
  41.                 client_notes: [""],
  42.                 purchase_order_number: [""],
  43.                 order_reference: [""]
  44.             });
  45.  
  46.         } else {
  47.  
  48.             // Set the validators for the create/update property form
  49.             this.instructionPropertyForm = this.fb.group({
  50.                 address_1: ["", Validators.required],
  51.                 address_2: [""],
  52.                 town: ["", Validators.required],
  53.                 county: [""],
  54.                 postcode: ["", [Validators.required, Validators.pattern(/^(GIR 0AA)|((([A-Z][0-9][0-9]?)|(([A-Z][A-HJ-Y][0-9][0-9]?)|(([A-Z][0-9][A-Z])|([A-Z][A-HJ-Y][0-9]?[A-Z])))) [0-9][A-Z]{2})$/)]],
  55.                 capscan_uprn: [""],
  56.                 landmark_uprn: [""],
  57.                 longitude: [""],
  58.                 latitude: [""],
  59.                 floor_area: [""],
  60.                 number_of_bedrooms: [""],
  61.                 property_type_id: [""],
  62.                 total_rooms: [""],
  63.                 // property_status: [""],
  64.                 // customer_type_id: [""],
  65.                 boiler_location: [""],
  66.                 electric_meter_location: [""],
  67.                 water_meter_location: [""],
  68.                 gas_meter_location: [""],
  69.                 pets: [""],
  70.                 occupied: [""],
  71.             });
  72.  
  73.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement