Enabling / Disabling a field on a Form

Hi, I would like to enable a field for user input query value,
but once the data is returned to the form, I want to disable that
field so that it cannot be editable. (i.e. it is the PK for that
table). Anyone has any suggestions / Ideas.
Thanks
Srini

Hi,
If you can find the form element in Javascript using
document.forms[0].elements[i] - where i is the element number
then you can disable it by
document.forms[0].elements.disabled=true;
and enable it by
document.forms[0].elements[i].disabled=false;
the javascript would be something like:
if (document.forms[0].elements[i].value > "") {
document.forms[0].elements[i].disabled=true;
this will disable the field if it has a value.
you should put this in AFTER displaying the form since otherwise
the form is not there for the code to run on.
Regards Michael

Similar Messages

  • Does anyone know how to enable/disable a dropdown menu in Forms at runtime?

    Is there a way how to disable/enable dropdown menu for menus that have multiple sub levels in Oracle Forms? I am trying to use the set_menu_item_property function but this takes 'menu.item' format for the first argument. I am trying to enable/disable a menu item in the form of 'menu.item.subitem' and was not able to do it using this function. If anyone knows a different function or method, please reply. I have shown an example below.
    Setup -> Software -> Front Page
    From the above example, I can enable/disable Software using set_menu_item_property function. But, how do I enable/disable the Front Page menu in Oracle forms at runtime?
    Thanks
    Edited by: user480347 on Aug 24, 2010 3:37 PM

    Yes you are on the right track. You need to pass then complete menu name to set_menu_item_property
    Immediate_parent menu.item_name e.g
    For example you have menu like this
    Id like
    A1    A10 > A1010
    Home > Input > Form 1
    A1    A10 > A1020
    Home > Input > Form 2 To disable Form 2 you must pass menu name as
    A10.A1020Hope it helps

  • Enable / disable classification fields in material master?

    Hi experts
    We hope to assign one group who could change the matieral master fields on classification.
    Like one gropu who could change the classification fields- date, on mateiral master . others only could display
    Is that possible to modify the program to enable or disable one field ?
    Now we have mm02 for normal user and zmm02 for specific user.
    Thanks
    ALice

    Hi
    When you create a role with transcation MM01, the Authorisation objects related to Classification are inherited from the transaction.
    If you want to give the user only diplay options maintain the Activities as 03 for the authorisation object C_KLAH_BKL & give the Class Type Z01.
    For the Chracteristics (Class maintenance)in the authorisation object C_TCLS_MNT maintain Activity 03 & Class type Z01
    Similarly create another role & assign it to the user whco is authorised to create or chnage values, Give hm the activiies 01,02 & the class type Z01.
    I feel that there is no requiremnt of changing the Program, as the authorisation objects are laready available.
    Thanks & Regards
    Kishore

  • How can we make disable a Field of a FORM at run-time?

    Hi to everybody,
    I want to know that how can we make a filed DISABLE at runtime <whenever we run a FORM>.
    I know about SET-ITEM-INSTANCE-PROPERTY but don't know how to use it,
    please make it clear.
    I will be gratefull to all of you
    Thanking you in advance.

    There's no property values for enabled or disabled in SET_ITEM_INSTANCE_PROPERTY.
    Instead what you can do is set INSERT_ALLOWED, UPDATE_ALLOWED and NAVIGABLE to FALSE which basically what a disabled item behaves like.
    Regards,
    Tony

  • Is it possible to enable & disable a field in a multi record block

    When I enable a field in the multi record block all the records for that field are enabled or vice versa. I don't want that.
    If I enable a field for one record the rest of them should stay as it is.
    Thanks for any help.
    Syed Jaleel.

    You can set update_allowed,insert_allowed, Navigable false for
    field in multirecord block using
    Set-Item_Instance_Property;
    Eg:
    Set_Item_Instance_Property('BlkName.item_name',Record_number,Insert_Allowed,Property_False);

  • Enable/disable fields in Workspace form

    Okay here is my scenario. I need to disable some fields on a form depending on which user logs onto workspace to open the same form.
    1. User1 logs onto workspace and opens leave request form, fields at the top of the form are enabled for the user to fill out, bottom fields which are for leave request administrator to fill out are disabled but visible.
    2. User1 fills out top portion of leave request form and completes form. Workflow sends form to leave request administrators "To do" list in Workspace.
    3. Administrator opens up submitted form in Workspace and sees User1's filled out data on the form and the bottom fields are now enabled for administrator to approve or dissaprove. Bottom fields only include two check boxes, two text fields and one date field.
    Now how is this done? I am sure their maybe scripting involved? if so what is it and at what events in the form? Is this whole process done in the form or through Admin UI or Workebench as well? Please help!!!!!!!!!

    Hi Rahat,
    You can use the same form and enable/disable some fields according to the user's role with only little scripting. Review the steps the below:
    1-First place a hidden field ("user_role") in your form
    2-Insert a script object into your form onder "Variables" in object hierarchy and write a script for enabling/disabling the fields (regarding the value of "user_role")
    3-On the initialize and change events of the "user_role" call your script object
    4-On your process design, put a SetValue service before User tasks. In the asssignment you should set the desired user_role to the form, so that the script is triggered in your form and the fields are enabled/desiabled
    Fro further needs on your form or process design you can contact us from: http://www.kgc.com.tr/company_Contact.html
    Oguz
    http://www.kgc.com.tr

  • Enable/Disable item Based Value from Select in Tabular Form

    Hi Guys
    I want to Disable text field in Tabular form, Based on the Select List Item Value.
    Let's Say
    I'm having one select lista and text box in each record in tabular form.
    Select List having 2 items ... Add Text(return value 1) and No Text(return value 2)
    if value =1 then i want to enable text box , so user can enter value.
    if value=2 then text box won't allow to add text or will become disalbe.
    Please Help
    Thanks

    Hi,
    You can do this by using a small java script
    <script language="JavaScript" type="text/javascript">
    <!--
    function FldEnableDisable(pThis)
    if (pThis == 50)
      $x('P2_TEXT').disabled=true;}
    else
    { $x('P2_TEXT').disabled=false; }
    //-->
    </script>Here P2_Text is the text box whose value I am enabling or disabling based on the selected value from a List box. On The list box I have onChange="javascript:FldEnableDisable(this.value)" ( You can specify this under HTML Form Element Attributes)
    Thanks,
    Manish Jha

  • Is there a way to enable/disable a tabular form item based on the value of a second item?

    Hi Everyone,
    I have a tabular form based on a collection.   The column c050(maps to f30) will be either Y/N.  If it is Y, then I would like to enable column c024( maps to f24) (which happens to be a radio button based on lov).  If the value of c050 = N, then disable c024.   There are potentially many rows, and the item c024 would only be enable/disabled for the specific row.   So if row 1 has c050=Y and row 2 has C050=N then row 1 c024 is enabled, and row 2 c024 is disabled.  Hope that makes sense.
    I have created a dynamic action called enable/disable HMS fields.
    event=CHANGE
    selection type = jquery selector
    jquery selector = input[name='f30']
    condition EQUAL TO
    value Y
    true action1 - enable, jquery selector, input[name='f24']
    true action 2 - alert, You have added an HMS Species.   There may be additional data to enter.  thanks
    false action1 - disable jquery selector, input[name='f24']
    false action2 - alert, no hms worries.
    The alerts in both cases show properly...but nothing seems to happen to f24.....what am I doing wrong?
    thanks

    Agh! This is the first time you mention this is a radio button!  That changes things a lot! As you can see, the format is different (f24_0001_0001) than what we have discussed (f24_0001).
    Radio buttons have their own quirks.  My bad, I should have asked what you had.  But since you said your original selectors on input were working I just thought these were text fields or something like that.
    How about you change it to a drop down list just so that you can see all work?  And fully understand it.
    Then you can work out the radio button option.
    If that doesn't get you there... I'm going to ask you setup an example in apex.oracle.com and give me credentials to log in and take a look.
    I could re-try the js on my side with a radio but it will take some time.
    So just to be clear... f30 is a drop down and f24 is a radio?
    See, this line:
    $x_disableItem("f24_" + row, true);
    Is NEVER going to find the radio buttons because it's missing the 3rd 0001 and 0002 (how many options do you have?)
    So perhaps you try it like this:
    $x_disableItem("f24_" + row + '_0001', true);
    $x_disableItem("f24_" + row + '_0002', true);
    ... keep going for the options...
    Do the same for the false of course.
    But I think this needs a better approach if you'll have radio buttons.  I just need to work it out.
    Ok, go try things...
    Thanks
    -Jorge

  • Disable Check box in tabular form

    Hi,
    I am working on apex4.1. I have created a tabular form.There is 2 columns Approve and Cancel. if I tick on cancel check box then Approve check box column should disable and vice versa.
    How can i do this ?
    Thanks & Regards
    Vedant

    hi,
    this thread maybe help you
    Tabular Form: Enable/Disable a field based on the status of a check box
    regards,

  • Dynamic enabling of input fields via radio btn in report selection screen?

    Hi there!
    I was wondering whether one can dynamically enable/disable input fields on a selection screen of a report-program.
    Or is this only possible for selection screens in dynpro-programs?
    If possible for reports - could you give an example?
    Thanx a lot.
    Andreas

    Hi,
    yes..You can dynamically disable and enable inputs fields in the selection screen..
    Check this ex..If you press the first radio button..The second input will be disabled...And vice versa..
    PARAMETERS: p_r1 RADIOBUTTON GROUP g1 USER-COMMAND usr DEFAULT 'X',
    p_r2 RADIOBUTTON GROUP g1.
    PARAMETERS: p_input1 TYPE matnr MODIF ID m1,
    p_input2 TYPE matnr MODIF ID m2.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF p_r1 = 'X'.
    IF screen-group1 = 'M2'.
    screen-input = '0'.
    ENDIF.
    ELSE.
    IF screen-group1 = 'M1'.
    screen-input = '0'.
    ENDIF.
    ENDIF.
    MODIFY SCREEN.
    ENDLOOP.
    Thanks,
    Naren

  • Change UDF field on system form to enabled = false

    When doing this, it works fine (on the item master form).  The udfs that I don't want to be editable are disabled (grayed out).  But as soon as anything is typed into ANY field on any pane in the main form or into any of my editable UDFs, the disabled fields immediately become enabled again!  (If I listen for key-down on a field & redisable my UDFS it works, and further entry into any field does not affect the enabled status!  This is obviously no solution, though.  There might be over a hundred fields on this form and it's impratical to listen for key down on all of them!)
    I'm doing this as a proof of concept, and if we get it right, we're likely to sell this customer SAP B1, so I'd really like to get this right!
    So, searching the forum, I see something about SetAutoManagedAttribute & I try setting the editable attribute to false for these fields.  That line of code crashes:
    item2.SetAutoManagedAttribute(BoAutoManagedAttr.ama_Editable, SAPbouiCOM.BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_False)
    with a message: "Exception from HRESULT: 0xFFFFE4A2."
    (NO text with ANY of these HRESULT messages - where can i find info on them?)
    I thought maybe the problem was that I can't use the SET feature for UDFS so I've tried it on the itemcode field itself and this bombs out too!
            <B1Listener(BoEventTypes.et_MENU_CLICK, False)> _
            Public Overridable Sub OnAfterMenuClick(ByVal pVal As MenuEvent)
                Dim form As Form
                form = B1Connections.theAppl.Forms.ActiveForm
                Dim it As Item = form.Items.Item("5")
                Dim pl As Integer = form.PaneLevel
                If pl <> 1 Then
                    form.Freeze(True)
                    form.PaneLevel = 1
                    form.Freeze(False)
                    Try
                        it.SetAutoManagedAttribute(BoAutoManagedAttr.ama_Editable, SAPbouiCOM.BoAutoFormMode.afm_Ok, BoModeVisualBehavior.mvb_True)
                    Catch ex As Exception
                    End Try
                End If
                If form.PaneLevel <> pl Then
                    form.Freeze(True)
                    form.PaneLevel = pl
                    form.Freeze(False)
                End If
    (I saw another post on the forum about not being able to change the visible attribute unless the current pane contained the field being changed, so that's why I'm trying to switch it & switch it back and I've tried the SET command without the panelevel switch and I always get the same error)
    PS I'm at p16  - THANK YOU!

    Hi John,
    Do the UDFs have to be on the Item Master window itself (ie can they be left on the UDF tab)?
    Would this work as a solution?...
    Use the UDF settings to create 2 different UDF categories and assign the 2 different sets to these categories. Then, when the user selects a particular item, your add-on can check the item group and automatically change the UDF category to reflect the correct item group. Sure, it doesn't set the other fields to inactive but it does hide them from the user. Only issue would be if you have other UDFs that are generic (ie non-group specific) as you can only assign a UDF to a single category.
    Kind Regards,
    Owen

  • [ADF UIX] Dynamically enabling/disabling fields

    Hi
    Another newbie question.
    Does anybody have any pointers on how to dynamically set the read-only property of a messageInputText field dependent on the value of another field in an ADF UIX input-only-form?
    To set the scene: I have a VO with the following columns:
    1) id
    2) subtype (values L or N)
    3) field1 (only editable when subtype = L)
    4) field2 (only editable when subtype = N)
    When the user creates a new record, the subtype will default to L. I need field1 to be enabled and field2 to be disabled. If the user changes the subtype field to N, field1 must be disabled and field2 enabled.
    Is this possible? Or is this best left to the spanking new ADF Faces?
    (My environment: JDeveloper 9.0.5.2 build 1618)
    Thanks!
    CM.

    Some research reveals one method to do this: EL (Expression Language).
    As an example I had the following messageLovInput that I wanted to dynamically make read-only (similar to enabling/disabling) dependent on a value in another field 'InputRequiredInd'. As such the following tag was implemented:
    <messageLovInput
    model="${bindings.DsvId}"
    id="${bindings.DsvId.path}"
    destination="dataSetValidationRulesLevelOneLov.uix"
    partialRenderMode="multiple"
    partialTargets="_uixState"
    readOnly="${!empty bindings.InputRequiredInd.inputValue ? false : true}"/>
    You'll note in the readOnly element an "EL" expression. Essentially this says if the InputRequiredInd is not empty then return false otherwise true.
    A useful reference:
    http://www-106.ibm.com/developerworks/java/library/j-jstl0211.html
    I hope this is helpful to someone!
    Cheers,
    CM.

  • Enable/disable/defaulting the radio button in tabular Form

    Hi friends,
    I have one radio button column in my tabular form with 3 values for it.
    <li>FC
    <li>BC
    <li>EC
    I need to enable/disable the radio buttons according to the position of the user.
    If the position of the user is CEO means,
    then FC radio button has to be checked defaultly and also for him he needs to have BC and EC radio buttons to be enabled.
    If the position of the user is between(1-4) grades means,
    then FC radio button has to be disabled, but BC radio button has to be checked defaultly and also for him he needs to have EC radio buttons to be enabled.
    If the position of the user is between(4-6) grades means,
    then FC, BC radio button has to be disabled, but EC radio button has to be checked defaultly.
    How i can achieve this radio button enabling/disabling and defaulting it dynamically according to the user.
    Where i need to specify this kind of restriction inorder to work for me in my application.
    Brgds,
    Mini

    Hi Bob,
    thanks for your reply first, and your suggestion too.
    I tried in the below manner on the lov definition of my radio button and it hide/shown according to the user who logs into the application.
    SELECT 'FC' d, 'FC' r FROM DUAL WHERE lower(:APP_USER) = (select lower(user_name) from apps.xxhy_ams_details_v where upper(job_name) = 'CEO')
    UNION ALL
    SELECT 'BC' d, 'BC' r FROM DUAL WHERE lower(:APP_USER) IN (select lower(user_name) from apps.xxhy_ams_details_v where grade_name
    BETWEEN 1 and 4 OR lower(:APP_USER) = (select lower(user_name) from apps.xxhy_ams_details_v where upper(job_name) = 'CEO'))
    UNION ALL
    SELECT 'EC' d, 'EC' r FROM DUALBut how i can check the radio button defaultly according to the user who logs in .
    <li> If the employee with the position CEO logs into the application means, he needs to have FC to be checked defaultly.
    <li> If the employee with the grade between(1-4) logs into the application means, he needs to have BC to be checked defaultly.
    <li> If the employee with the grade between(5-12) logs into the application means, he needs to have EC to be checked defaultly.
    Note:
    Instead of hide/show the radio buttons defaultly whether it is possible to enable/disable the radio button according to the user who logs into the application.
    Brgds,
    Mini...

  • Use Javascript to disable fields in tabular form built by wizard

    i know this type of disable question has been asked before and i have searched the forum thoroughly but the solutions always seem to be for items i.e P1_NAME and i do not have these as my form is built by a select statement
    i have worked out the syntax (i think)
    <script language="javascript" type="text/javascript">
    function desactiverElement(item)
    var x = document.getElementById(item);
    if (x)
    x.disabled = true;
    </script>
    to disable and think it goes in the html header or a html region before footer but i cannot work out how to disable the field because i cannot work out how to reference them
    i.e get the value for 'item' in the code
    any help i would be extremely grateful for
    cheers Chris

    the CENTRE_NO field has to be unique , and when i am doing my validation check ,if the user amends the field by accident and then replaces the value it gets an error when it shouldn't
    wish it was as simple as forms just change property to update_allowed = false !!

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

Maybe you are looking for