Published on : May 26, 2020

Sample Call

[do.@cmr]
[cmr-service.employment-info-controller.default_response_controller /]
[/do.@cmr]

Input

KeyDescriptionSample Value
@cmr.step_config.events.launch Array of events to call at launch of screen[flow category=”” action=”” label=”” /]
[section category=”” action=”” label=”” /]
[step category=”” action=”” label=”” /]
@cmr.lapp.job_typeJob Type of the applicantsalaried / self-employed
@cmr.lapp.official_emailOfficial email of applicant
(Salaried)
@cmr.lapp.employer_nameEmployer name of applicant
(Salaried)
@cmr.lapp.employment_yearEmployment Year of applicant
(Salaried)
@cmr.lapp.home_addr_line1Address Line 1 of applicant’s current address
(Salaried)
104, Kalyani Nagar
@cmr.lapp.home_addr_line2 Address Line 2 of applicant’s current address
(Salaried)
Pune
@cmr.lapp.home_pincodeSelected pin code of the applicant’s residence
(Salaried)
411006
@cmr.lapp.total_work_experienceTotal Work Experience
(Salaried)
@cmr.lapp.business_nameBusiness name
(Self Employed)
@cmr.lapp.years_of_businessYears of Business
(Self Employed)
@cmr.lapp.business_addr_line1 Business Address Line 1
(Self Employed)
@cmr.lapp.business_addr_line2Business Address Line 2
(Self Employed)
@cmr.lapp.business_pincode Business Address Pincode (Self Employed)
@cmr.response_content.fields.
current_address.label
Current Address labelAddress Line 1
@cmr.response_content.fields.
current_address.placeholder
Current Address PlaceholderAddress Line 1
@cmr.response_content.fields.
pincode.label
Current Address Pincode LabelPincode
@cmr.response_content.fields.
pincode.placeholder
Current Address Pincode PlaceholderPincode
@cmr.response_content.title Header – Title of the screenEmployer Information / Business Information
@cmr.response_content.descHeader – Description of the screenWe require the residence details for contactibility

Output

Salaried
Self Employed

Logic

  • Create Events Array
  • Fire Google Analytics Array
[cmr-service.events.ga_events data="{@cmr.events_data}" /]
  • Fetch existing data from the @cmr.lapp
  • Check Job Type
  • Generate Form (Employer Details), in case of job_type = salaried
  • Generate Form (Business Details), in case of job_type = self-employed
  • Fetch Employment Year Options from Taxonomy
//** Fetch options **//
[query.get_terms taxonomies="{@cmr.response_content.fields.years_of_business.taxonomy}" hide_empty=0 parent="" o.set=template.options /]
  • Add javascript function to validate form and change listeners
function validateForm(){
if( $('#current_address').val()=='' ||
$("input[name=official_email]").val()=='' ||
$("input[name=employer_name]").val() == '' ||
$("input[name=office_addr_line1]").val() == '' ||
$("input[name=office_pincode]").val() == '' ||
$("input[name=total_work_experience]").val() == '' ||
$("input[type=radio][name=employment_year]").is(':checked')===false
){
$(".continue-btn-emp-details").addClass("disabled");
} else{
$(".continue-btn-emp-details").removeClass("disabled");
}
}

$(' input[name=official_email], input[name=employer_name], input[name=office_addr_line1],input[name=office_addr_line2], input[name=office_pincode], input[name=employment_year], input[name=total_work_experience]').change(function(){
validateForm();
});