javascript - how to set default value in dropdownlist based on another dropdown selected item -
i have basic html form,when page loads loads form initial values no data.
in single page have added 2 tab containers left side grid , right side html form
what ever records loaded in grid when double click on fill right side form.
my requirement based on 1 type dropdown selected value how can default value in product dropdown.
for eg : have column in left side grid type data fab..when doubleclick on row form filled selected value fab. when selected value in type dropdown fab need check null or empty values in product dropdown column , set default value.
the values in dropdownlist product is
null null sh_ty hg_iu null null
the values in dropdownlist type is
fab loi tyu swa
this code trying fill form
here column names
var formfields = [ {column: 'producttypeid'}, {column: 'productcodeid'},], var fillform = function (record) { (var in formfields) { if (formfields[i].column != null) { var currentvalue = record[formfields[i].column]; var initvalue = record[formfields[i].column + "_init"]; formfields[i].ref.set('value', (currentvalue == null) ? '' : currentvalue); if (formfields[i].column == 'btdate') { formfields[i].ref.set('value', (currentvalue == null || currentvalue == '0') ? '0' : '1'); } tried check not working if (formfields[i].column == 'producttypeid') { if(currentvalue == "fab" || currentvalue == "swa") { formfields[i].ref.set.column.productcodeid('value', (currentvalue == null || currentvalue == '' || currentvalue == currentvalue) ? 'a_cl_fa': currentvalue); } }
you need use property way selected dropdownlist value differ of null.
Comments
Post a Comment