Form behaving differently in different browsers

Hi Team I have a On Form Populated event to disable a drop down list and date field. Conditions
  • Drop Down Menu should be disabled after user input
  • Date should be disabled on create itself
I have the below code getFieldByName("approval_date").getElementsByTagName("input")[0].setAttribute("disabled", ""); getFieldByName("approval_date")getElementsByTagName("input")[1].setAttribute("disabled", ""); getFieldByName("approval_date").getElementsByTagName("input")[1].src = "../images/calendar-disabled.svg"; var varMyddl = getFieldByName('input_type'); if(varMyddl) { setTimeout(function(){ varMyddl.getElementsByTagName("input")[0].disabled = true; varMyddl.getElementsByTagName("button")[0].disabled = true; }, 1);} In Chrome Browser On Create, Date and input_type is also disabled On Save : Not able to save as both are mandatory fields In IE Browser On Create, Date and input_type is not disabled On Save : Both are disabled Am I missing something ?    
  • Hello, There are some differences in the supported JavaScript functions between IE and Chrome, but I don't believe any of those differences would be causing this exact issue. There are a couple things you can try to get the desired behavior.
    1. Move the JavaScript that disables the date field into it's own setTimeout
      • In my testing, it seems that this is only necessary on newly created items
    2. Increase the amount of time on the timeouts
      • In my environment, 200ms seemed to do the trick for new items
    3. Use aras.getItemProperty(parent.item, "Property Name"); to check for the value of a property
      • Your current check of if(varMyddl) will always return true as long as that field exists. It doesn't currently check for any user input
    Chris
    Christopher Gillis Aras Labs Software Engineer
  • Thank You so much Christopher. This fixed the issue.