How to make field that retrieve value from AJAX-client script become read only?

Hi,

I make an SSA field that upon being select will use ajax client side script to get data base on SSA field link to another entity, the problems occur that I want to prevent user from changing the retrieved value but I can't use oncreate script since it will ignore input data. So what script do I need to achieve this. The field that I want to make readonly after select the Item No. field are Quantity,Available,Reserve and Lended.

Best Regards,

Natha

  • 0

    Hi,

    From your post I understood that you need to auto populate Quantity, Available, Reserve and Landed fields when user selects/changes Item Number field. Finally needs those fields to be in Read Only mode (i.e. Once values in the fields are set, users cannot change them.)

    If I am correct with my assumption, you need to write a client side script. This script will read the Item Number value from screen and pass it as an parameter to an ASP page to retrieve require values. Finally setting them Into the fields and making fields as Read Only using client side script.

    Hope this helps!

    Sincerely,

    Dinesh

  • 0

    Dear Natha,

    try to use a client side code to prevent any effect on the value as the below code.


    if (window.addEventListener){window.addEventListener("load", HideFields, false)}
    else if (window.attachEvent){window.attachEvent("onload", HideFields)}
    function HideFields()
    {
    $('#Quantity)').attr('readonly', true);
    }


    note :
    in the above code just replace Quantity with the really fieldname.

  • 0

    Thank you Dinesh and Faleh Al Tamimi, I will try your solutions.

    Best Regards,

    Natha