2 Replies Latest reply on Jan 14, 2013 1:34 PM by Cashy

    Readonly cell in tabular form

      Hi Guys,

      I have a tabular form with a cell that I want to make readonly if a text item (P10_INVENTORY_ITEM_ID) is not null.

      I have the following code which I just cant seem to get working
      <script language="javascript" type="text/javascript">
      function make_existing_column_readonly()
         var vinv =  document.getElementById('P10_INVENTORY_ITEM_ID');
         //var vinv =  '123';
          var l = vinv.length;
            if (l > 0) { // has a value
                var curr_id = document.wwv_flow.f10.id;
                $x(curr_id).readOnly = "readonly";
                $x(curr_id).style.background = "FFFF99";
      If I uncomment the line var vinv =  '123'; and comment out var vinv =  document.getElementById('P10_INVENTORY_ITEM_ID'); the code works as expected.

      As :P10_INVENTORY_ITEM_ID has a value when I running the test, it should make the cell readonly. I'm pretty sure that the value of P10_INVENTORY_ITEM_ID is not getting into the variable vinv.

      Any advice would be great.