[form] page_title= add_form_title=Contract Details view_form_title=Contract Details edit_form_title=Contract Details id_column_name=application_id form_validation=1 form_name=frm_contract form_method=POST enctype= form_action= data_collection_name=application_info edit_link=/master-data/add-photographer?photographer_id= ;back_link=/master-data/photographers ;cancel_link=/master-data/view-photographer?photographer_id= form_element_type=1 [dropdowns] ;id name data_collection_name cssClass rows value id_column_name text_column_name select_text multiple ;--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- estblishment_id, estblishment_id, establishment_info, validate[required], place, estblishment_id, estblishment_id, esname, , 0 am_id, am_id, contract_info, validate[required] width-200, appentice_mood, am_id, am_id, am_mode, --Select Mode--, 0 tm_id, tm_id, contract_info, validate[required], training_mood, tm_id, tm_id, tm_mode, --Select Training Mode--, 0 trade_id, trade_id, contract_info, validate[required], trade, trade_id, trade_id, tradeTxt, , 0 grp_id, grp_id, contract_info, validate[required], stu_group, grp_id, grp_id, grp_txt, --Select Batch--, 0 level_id, level_id, contract_info, validate[required], level_list, level_id, level_id, tevelTxt, --Select NVQ Level--, 0 ;dropdown_services, service_id, meter_info, validate[required], dropdown_services, service_id, service_id, service_description, -- Select a service --, 0 ;dropdown_meter_full_name, meter_full_name, meter_info, validate[required], dropdown_meter_full_name, meter_full_name, meter_full_name, meter_full_name, -- Select a meter --, 0 ;reading_mode, reading_mode, meter_info, width-200, dropdown_reading_mode, reading_mode, reading_mode, reading_mode, , , [hidden fields] ;field_id, value_filed, ;-------------------------------------------------------- customer_id, customer_id con_id, con_id ce_id, ce_id student_id, student_id [fields] ;caption, type, display_mode, field_id, value_filed, cssClass, required(1 or 0), compare_filed, row_css ; 0 or null = All ; 1 = Edit only ; 2 = Add only ; 3 = View only ;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Contract Number, text, , conract_no, conract_no, , , , col-md-6 Apprentice Mode, dropdown, , am_id, am_mode, form-control col-sm-4, , , col-md-6 Training Mode, dropdown, , tm_id, tm_mode, validate[required] col-sm-4, 1, , col-md-6 Batch, dropdown, , grp_id, grp_txt, validate[required] col-sm-4, 1, , col-md-6 Trade, dropdown, 3, trade_name, trade_name, validate[required] width-600, 1, , Trade, dropdown, 2, trade_id, trade_id, validate[required] width-600, 1, , Trade, text, 1, trade_name, trade_name, validate[required] width-600, 1, , NCS Code, text, , trade_code, trade_code, validate[required] width-600, 1, , col-md-6 NVQ Level, dropdown, , level_id, level_id, validate[required] width-600, 1, , col-md-6 Start Date, date, , start_date, start_date, , 1, , col-md-6 End Date, date, , end_date, end_date, validate[required] width-600, 1, , col-md-6 Duration in Months, text, , duration, duration, validate[required] width-600, 1, , col-md-6 ;Package No, text, , pkg_no, pkg_no, validate[required] width-600, 1, , col-md-6 Assign date, date, , signed_date, signed_date, form-control, , , col-md-6 Establishment, display, 2, estblishment_id, esname, validate[required] width-600, 1, , Establishment, dropdown, 1, estblishment_id, esname, validate[required] width-600, 1, , Establishment, dropdown, 3, estblishment_id, esname, validate[required] width-600, 1, , [buttons] ;button_ype, button_id, button_caption, css_style, button_location, button_mode ;(button/submit/rest) left/right 0 = View | 1 = Edit ;-------------------------------------------------------------------------------------------------------------------------------------------------------- submit, btn_save, Save, btn-primary, right, 1 button, btn_edit, Edit, btn-primary, right, 0 ;button, btn_back, Back, btn-default, right, 0 ;button, btn_change_meter_full_name, Change Meter Tag, btn-primary, left, 1 ;submit, btn_save, Save, btn-primary, right, 1 ;button, btn_cancel, Cancel, btn-default, right, 1 ;button, btn_back, Back, btn-primary, left, 1 [script] ;$('#btn_save').click(function () { $('#frm_contract').submit(function() { ;var action = $(this).attr('action'); var action = "/contract/update"; var data = $('#frm_application, #frm_contract').serialize(); console.log(data); $.ajax({ url : action, type : 'POST', data : $('#frm_application, #frm_contract').serialize(), success : function(result) { window.location.href = "/contract"; console.log(result); } }); return false; }); ;}); $(document).ready(function () { $("#am_id").change(function () { var selId = $("#am_id").val(); if(selId !=1) { ;$('#grp_id').parent().hide(); $("#grp_id").prop("disabled", true); }else { ;$('#grp_id').parent().show(); $("#grp_id").prop("disabled", false); } }); });