Lock/Disabled/Readonly Element using Javascript

hi,
how to lock or disabled or make readonly element using javascript in APEX 3.2
i need to lock/readonly popup element in the form
CAN ANYONE HELP ME?

A little complex, so possibly there will be a simpler solution than this.
Immediately following the readOnly statement enter this code
  $x('P60_NAME').readOnly="readOnly";
  latag = $x('P60_NAME_holder').getElementsByTagName('A');
  for (i=0;i < latag.length; i++){
     latag.removeAttribute('href');
This code removes the HREF attributes from the Image anchor.
This should fix it.
Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to hide/disable menu items using Javascript in Acrobat 9 pro or later

    We just wanted to know on how to hide/disable menu items for e.g. 'Open' menu item under 'File' menu in Acrobat 9 or later on Mac using Javascript. It would be useful if you could provide if any other option is in place already.

    Not sure it will work, but you can try using the app.hideMenuItem() method. See reference here.

  • How to disable the ribbon using javascript

    when open a PDF document using acrobat X, there is a Tool ribbon in the top right side (there is also a comment ribbon and share ribbon), how to disable or remove the Tool ribbon using javascript?
    I try to use app.listToolbarButtons() and app.hideToolbarButton(...) but not working.
    Any ideas?

    Not possible.

  • Dynamically validating datatable elements using javascript

    Hai, iam using jsf, and having Xml mapping to the form elements to display the data . Iam using <h:datatable> inside which iam haveing repeated elements, i need to do a javascript validation before displaying the form element present inside the <h:datatable> columns.Iam also using <j4j:idproxy> , the java script is working for 1 iteration but it is the dataof the form element is not getting overridden in the 2nd iteration, It is somethinglike this below.
    <TR id="buiCoverRowId" style="display:none;">
    <TD height="9" width="200"></f:verbatim> <h:outputText
    styleClass="outputText" id="text7"
    value="Buildings Cover"></h:outputText><f:verbatim></TD>
    <TD height="9" width="516"></f:verbatim> <h:outputText
    styleClass="outputText" id="buildCoverId"
    value="#{pathPart.xpathMap['./BuildingsCover/CoverDetail/SumInsured/Amount']}">
    </h:outputText> <f:verbatim></TD>
    </TR>
    <TR>
    <TD></f:verbatim><f:verbatim>
    <h:inputHidden id="hidBuiCoverId"
    value="#{pathPart.xpathMap['./BuildingsCover/CoverDetail/SumInsured/Amount']}">
    <j4j:idProxy id="hidBuiCoverId_" />
    </h:inputHidden>
    </f:verbatim><f:verbatim></TD>
    <TD></f:verbatim><f:verbatim>
    <h:inputHidden id="hidExBuiCoverId"
    value="#{pathPart.xpathMap['./BuildingsCover/ExcludedInd/Value']}">
    <j4j:idProxy id="hidExBuiCoverId_" />
    </h:inputHidden>
    </f:verbatim><f:verbatim></TD>
    </TR>
    <SCRIPT>
    alert("HAI");
    var buidcover = document.getElementById('hidExBuiCoverId_').title;
    var buidcoverR =document.getElementById(buidcover).value;
    alert("the value of buildcover----->"+buidcoverR);
    var buId =document.getElementById('hidBuiCoverId_').title;
    var entitybuId1 = document.getElementById(buId).value;
    entitybuIdT1 = trim(entitybuId1);
    alert("entitybuIdT1"+entitybuIdT1);
    var buExId = document.getElementById('hidExBuiCoverId_').title;
    var entitybuExId1 = document.getElementById(buExId).value;
    entitybuExIdT1 = trim(entitybuExId1);
    entitybuExIdU1 = entitybuExIdT1.toUpperCase();
    alert("entitybuExIdU1"+entitybuExIdU1);
    if(!(entitybuIdT1 == null || entitybuIdT1 == '') && ((entitybuIdT1 == "0")) && (entitybuExIdU1 == 'FALSE'))
    document.getElementById("buiCoverRowId").style.display="block";
    </SCRIPT>
    The form element is mapped to the xml. the above code is written within a datatable, iam using javascrpt within this to display the datat or not, it is working for first iteration but its not working for second iteration. Plz help me with this . Is there any way that i can use javascript so that it vvalidates the form elements even for the 2 iteration of the datattable. I am having thesame values (of the 1iteration) even during the 2 iteration. Plz help me with this asap.

    Got the solution.
    $("div.ms-acal-rootdiv div div div a").html().replace('Replace this text only.','Replaced Text');

  • How to set readOnly property using javascript

    Hi Folks,
    How do I make an inputtext readOnly using javascript?
    I have tried the following
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setProperty('readOnly', 'true');
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.readOnly = true;
    var textComp = AdfPage.PAGE.findComponent("textId");
    textComp.setAttribute('readOnly', 'true');None of the above works. Any idea?
    Thanks
    Vishal

    http://docs.oracle.com/cd/E12839_01/apirefs.1111/e12046/oracle/adf/view/js/component/rich/input/AdfRichInputText.html#getReadOnly__
    Get function for attribute for 'readOnly'. This attribute is secured. You may get it, but you may not set it. Any changes to this attribute will not be transmitted to the server.
    Setting readOnly inputText value using javascript.

  • Counting xml elements using javascript

    How can I count the number of certain xml elements inside the xml file that import.
    Example xml:
    <list>
         <product>
              <name>Product_01</name>
              <detail>info here</detail>
         </product>
         <product>
              <name>Product_02</name>
              <detail>info here</detail>
         </product>
         <product>
              <name>Product_03</name>
              <detail>info here</detail>
         </product>
    </list>
    I would like to count the number of product -elements in this example xml.
    I'm using javascript for scripting.
    Thanks.

    #target indesign
    #include "/Applications/Adobe InDesign CS3/Scripts/Xml Rules/glue code.jsx"
    var myDocument = app.activeDocument;
    var myCounter = 0;
    var myRuleSet = new Array (new ProcessProduct);
    with(myDocument){
        var elements = xmlElements;
        __processRuleSet(elements.item(0), myRuleSet);
    alert("Found " + myCounter + " product elements");
    function ProcessProduct(){
        this.name = "ProcessProduct";
        this.xpath = "//product";   
        this.apply = function(myElement, myRuleProcessor){
            with(myElement){
                myCounter++;
        return true;

  • Enabling/ Disabling UI Elements using Web Dynpr Java

    Hi Experts,
    I have certain UI Elements in the view layout, and i want to disable it based on conditions. I want only certain users to be able to edit the fields and the other set of users should only be able to view the data in the UI Elements and not EDIT. can any one hlep me out please...
    Thanks in advance.

    HI satish,
    well you can do this by binding the readonly or enable property of the input field to a context attribute of boolean type and then checking in the wddoinit method for the user authentication. If the user is authenticated then you can set the attribute to true.
    Authentication can be done by providing all the users with a role (say enable) for which you want the fields to be enabled and you can check for the roles of the logged in user and if that particular role is pesent there you can enable the fields.
    The following is the code that you can write in your Wddoinit method for the work.
    String strUserName = null;
         boolean rolestrflg = true;
       try {
               IWDClientUser clusr = WDClientUser.getCurrentUser();
                IUser sapUser = clusr.getSAPUser();
         if (sapUser != null) {
                             IUserAccount[] acct = sapUser.getUserAccounts();
              if (acct[0] != null) {
                                       strUserName = acct[0].getDisplayName();
                                   Iterator rolesit = sapUser.getRoles(true);
                   IRoleFactory rfact = UMFactory.getRoleFactory();
                   while (rolesit.hasNext()&& rolestrflg) {
                                                 String roleName = (String) rolesit.next();
                                                 IRole role = rfact.getRole(roleName);
                              if(role.getUniqueName().equalsIgnoreCase("Enable")) // suppose the role for enabling the fields is Enable
                                   wdContext.currentContextElement().setContrl(true);
                                   rolestrflg = false;
                              else
                   wdContext.currentContextElement().setContrl(false);
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    i hope this will solve your problem
    regards,
    Sarbjeet

  • How to Disable a Button Using JavaScript

    Hi,
    I want to disable a button based on a condition. I am using a template based button (button Alternate 3). I am using Theme 3. I have created buttons of type item but when I view the source there is no button name populated in the html. My javascript is not disabling the button.
    Please advice.
    Thanks
    sukarna

    Hi,
    You can't disable an A tag (FireFox, for example, will still let you click the "link").
    What you could do would be to create a second button that doesn't work and only show one of these at a time.
    I have done that here: [http://apex.oracle.com/pls/otn/f?p=35917:30]
    The Button has been based on a custom Button Template. The definition for this is:
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10C"&gt;&lt;a href="#LINK#"&gt;#LABEL#&lt;/a&gt;&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;a href="#LINK#"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/a&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;table class="t10Button" cellspacing="0" cellpadding="0" border="0"  summary="" id="#BUTTON_ATTRIBUTES#_DISABLED" style="display:none"&gt;
    &lt;tr&gt;
    &lt;td class="t10L"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_left.gif" alt="" width="4" height="24" /&gt;&lt;/td&gt;
    &lt;td class="t10C" style="padding:1px 4px;"&gt;#LABEL#&lt;/td&gt;
    &lt;td class="t10R"&gt;&lt;img src="#IMAGE_PREFIX#themes/theme_10/button_right.gif" width="4" height="24" alt="" /&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;This actually creates two buttons - the first one, which actually has the link, is visible to start with. The second one, which has no link at all, starts off as invisible.
    Both buttons use the #BUTTON_ATTRIBUTES# setting to get the button name into the ID - though the second button adds "_DISABLED" to this so that it has a unique, but known, ID
    Then it is just a case of calling a function to show one button and hide the other or vice versa:
    &lt;script type="text/javascript"&gt;
    function disableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "none";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "block";
    function enableButton()
    document.getElementById('P30_TEST_BUTTON').style.display = "block";
    document.getElementById('P30_TEST_BUTTON_DISABLED').style.display = "none";
    &lt;/script&gt;Another possibility is to add the #BUTTON_ATTRIBUTES# to the TABLE tag instead of the A tag in a new button template (based on a copy of the normal Button template). Then, the ID value would be applied to entire "button". You can then make this invisible using:
    $x('BUTTON_ID').style.visibility = 'hidden';The button will be removed from the page as far as the user is concerned, so they can not click the link.
    Andy

  • How to set a form element value using javascript?

    Hello,
    I have been using the following two functions in AS 9.0.2 to set form values in javascript and it works correctly. However, the same code does not work in AS 10.1.2.0.2. Would appreciate if someone could let me know how to set form elements using Javascript(onchange of a field).
    function set_item_value(p_field_name, p_value)
    var v_index, v_full_name;
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if (v_full_name[2] == p_field_name)
    document.forms[0].elements[v_index].value = p_value;
    function get_item_value(p_field_name)
    var v_index, v_full_name, v_return="";
    for(v_index=0; v_index<document.forms[0].length; v_index++)
    v_full_name = document.forms[0].elements[v_index].name.split
    if(v_full_name[2] == p_field_name)
    if(document.forms[0].elements[v_index].type != "radio")
    v_return = document.forms[0].elements[v_index].value;
    else
    if(document.forms[0].elements[v_index].checked)
    v_return = document.forms[0].elements[v_index].value;
    if(v_return == " ")
    v_return = "";
    return v_return;
    Thanks
    Dev

    This is not the best way to write JavaScript in Portal environment!
    You can't be sure that a form is the first in the html source!
    In Portal you change the order of your portlets, and also you can have several instances of the same portlet on the same page!!!
    You should use qualified form and field names!
    Please check the following JPDK methods:
    UrlUtils.htmlFormName
    HttpPortletRendererUtil.portletParameter

  • Disable button using javascript

    Hi,
    I'm sorry if this is a relatively simple problem, but I have tried several things and have searched the forum, but still no luck!
    I am trying to get a button in a form to be disabled or hidden on loading the page and only to become enabled or shown once an 'onclick' event occurs. I already have a javascript function running successfully on the 'onclick' event, so there is no problem with that.
    Preferably I would like the button to be template driven, but I realise that disabling/hiding it may only be possible with an HTML button.
    I have tried the following JavaScript, but it appears to do nothing:
    document.getElementById('P6_OK').disabled=true;
    $x_HideItemRow('P6_OK');
    If the JavaScript is ok it is probably the way I am implementing it into the HTML.
    Thanks
    Lucy

    Hi,
    I'm still having troubles with this (see above). If anyone has successfully managed to disable a button using JavaScript I would be interested in how they did it.
    To clarify, I have tried the following two pieces of script, among others:
    (1) document.getElementById('P6_OK').disabled=true;
    (2) $x_HideItemRow('P6_OK');
    I have read quite a few forum links and followed what others have done, but in vain.
    Thanks for your help
    Lucy

  • Create a disabled Select Option in javascript

    Hi
    By now, I want to create a SELECT object with disabled options by using javascript.
    I tried "selectObj.options[1].disabled = true", it can work in Netscape, but not in IE.
    Does anyone can help?
    Thanks
    Michael

    Just tried, but doesn't work to me. Here is the complete html source
    <html>
    <head>
    <title>Test</title>
    </head>
    <script>
    function check()
         var selectObj = document.createElement("SELECT");
         selectObj.options[0]     = new Option("abc",1);
         selectObj.options[1]     = new Option("def",2);
         selectObj.options[1].id     = "def_id";
         var d = document.getElementById("test");
         d.appendChild(selectObj);
         var opt = document.getElementById("def_id");
         alert(opt);
         opt.disabled = true;
    </script>
    <body>
    <div id="test" name="test"></div>
    check
    </body>
    </html>

  • RRI drilldown on structures using javascript and Web API

    Hi SDN community,
    We have devised a method to RRI on structure elements using javascript and Web API statements:
    var url = SAP_BW_URL_Get();
    zREP_UNIT_VAR1 = "ZN_MRU01";
    zREP_UNIT_VAR2 = "ZP_FPER";
    var zeroFISCYEARKey = getVar("ZPFYEAR");
    var zREP_UNITHierNodeKey = getVar("ZN_MRU01");
    var zREP_UNITHierNodeKey = trimString(zREP_UNITHierNodeKey);
    var zeroFISCPERVarKey = getVar("ZP_FPER");
    var zeroFISCPERKey = convertZeroFISCPERVarKeyToKey (zeroFISCPERVarKey);
    var zeroCURRENCYKey = getVar("ZPM_CURR");
    zREP_UNIT_TEMPLATE = "ZWT_CPERF_M50_UC_CHART";
    url = SAP_BW_URL_Get() + "&CMD=LDOC&TEMPLATE_ID=" + zREP_UNIT_TEMPLATE +"&VAR_NAME_1=" + zREP_UNIT_VAR1 + "&VAR_VALUE_EXT_1="  + zREP_UNITHierNodeKey  + "&VAR_NODE_IOBJNM_1=" + "0HIER_NODE" + "&VAR_NAME_2=" + zREP_UNIT_VAR2 + "&VAR_VALUE_EXT_2=" + zeroFISCPERKey + "&VAR_VALUE_EXT_3=" + zeroCURRENCYKey + "&CMD_1=DATA_PROVIDER%3DFY" + "%26FILTER_IOBJNM_1%3D"+ filter + "%26FILTER_VALUE_1%3D"  + parameter1 + "&CMD_2=DATA_PROVIDER%3DCMYTD" + "%26FILTER_IOBJNM_2%3D"+ filter + "%26FILTER_VALUE_2%3D"  + parameter1;
    SAPBWOpenWindow(url,"IO_Process_KPI_Report","width=screen.width, height=screen.height,menubar=yes, toolbar=no, scrollbars=yes, resizable=yes");
    Necessary conditions:
    The same Global Structure is in the Sender Query and the Target Query
    Question:
    Is there any other way to RRI on structure elements within a sender query to a target query using:
    BADI's, ABAP or any other method.
    Thank you.
    Simon

    Hi SDN Community,
    At the time of asking this question there were not many examples of BADI for RRI's.  I now see a number of examples we can use.
    Thank you.
    Simon

  • JavaScript for disabling htmlb elements

    Hello,
    in my bsp application i want to change the attribute disabled of htmlb:inputfields and htmlb:dropdownlistbox. I used following javascript:
    document.getElementById('controllerID_inputfieldID').disabled = 'true';
    document.getElementById('controllerID_inputfieldID').disabled = '';
    This isn't work right, because the disabled is displayed other than I set disabled in the htmlb tag (<htmlb:inputField id = "inputfieldID" disabled = "true") and I can choice a element in the dropdownlist.
    What is the correct javascript function for disabling htmlb elements?
    Tina

    I believe that the following will work for you, although I must caution that it is not likely supported by SAP. Any service pack upgrade or patch may break this code. Use at your own caution.
    This is from a function that can disable or enable different objects using Javascript. Setting the st attribute seems to be what it takes to make it readOnly. Setting the class just applies the disabled look.
          case "DROPDOWN":
            switch(mode)
              case "DISABLED":
                window.document.getElementById(ID).st = "r";
               window.document.getElementById(ID).className = "urCoB2TxtDdl urCoB2Ro";
                break;
             case "ENABLED":
                window.document.getElementById(ID).st = "";
                window.document.getElementById(ID).className = "urCoB2TxtDdl";
               break;
           break;

  • Using Scrollbars and also to disable individual element.

    I need to display two dimensional array of checkboxes using Labview 7.1. The two dimensional array should have  row headers and column headers.
    Also the row headers and column headers are to be scrollable. I was able to make separate scrollable row and column header array.
    But this the scrolling cannot be apllied on the two dimensional array of checkboxes. I tried but was able to make it one way only, that is scolling the row header array also scrolls the checkbox array row-wise but not column-wise.
    There is another problem with the two D array of checkboxes. My application needs some of the checkboxes to be disabled and others enabled. Since array does not allow individual elements to be disabled , i cannot use array .
    So please suggest how to go about this. I have attached a sample VI to explain .
    Attachments:
    Sample.vi ‏21 KB

    Hi Hema,
    Would it be acceptable for your application to use only one table, as shown in the attached idea.vi ?
    Instead of booleans, you have can compute 0/1 value, no ?
    Otherwise I don't know how to do...
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    idea.vi ‏10 KB

  • Using Javascript to disable field "Planned"

    Hi every one,
    I want to use javascript to disable "Planned" checkbox in Project Server 2013 because we want that user can not see this planned time and be confused with the Project Server's automatic changes for the planned time.
    <script type="text/javascript">
    document.getElementById("Ribbon.ContextualTabs.MyWork.Home.ShowHide.PlannedWork-Medium-checkbox").checked = false;
    </script>
    I found this code in this subject :
    http://social.technet.microsoft.com/Forums/projectserver/en-US/0beeed2d-bebc-4217-981a-41b1252c7cc2/disable-field-planned-in-timesheet?forum=projectserver2010general
    But I don't understand where to use it. If i create a custom webpart with this code, I've got a null exception when the page is loading.
    So, can you help me ? Maybe I need to use it in an other file ?

    Hi Patmol6,
    Basically, to add javascript to a PDP (or timesheet page for instance), 
    edit the page
    add the content editor webpart
    set it as hidden
    copy paste the code
    Note that you can also point from the content editor webpart to a js file embedding the javascript code
    Here are few examples (some are in PS2007, but the process is similar): 
    http://epmsource.com/tag/content-editor-webpart/
    http://badalratra.wordpress.com/2013/05/04/how-to-disable-pdp-custom-fields-using-javascript/
    http://badalratra.wordpress.com/2013/02/03/javascript-code-to-add-custom-descriptions-underneath-project-field-on-the-pdp-page/
    http://epmcorner.wordpress.com/tag/content-editor-web-part/
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

Maybe you are looking for

  • Multi cam shoot using  P2 cards. How to move clis to timecode positions

    multi cam shoot using P2 cards. How to move clis to timecode positions. We were using free TC. I want to a large # of clips from both cams. and have them move to the correct TC position on the timline. In Nuendo eith audio u hit apple a or ctrl a rig

  • Determining the primary key in a database table

    Hi people.. I am building an interface which displays the database information...according to the specified datasource name.. Up till now i managed to display the different tables and the respective attributes... Is there a way of how i can determine

  • Need suggestion finding weird thing in SSAS (value changed to -1)

    Hi guys, probably a weird question but ...I had a measure the other day in my cube that was #error, because I noticed my calculation had [status].&[1] while the value in the cube was defined as [status].&[0]. I checked my tables, views and all column

  • PSE 13 UI Very Small on Surface Pro 3

    I am running Photoshop Elements 13 on a Surface Pro 3, the UI is very small, not useable.  How can this be adjusted?

  • X240t anytime soon?

    Have read that when haswell arrives Lenovo will release the new gen of thinkpads. I'm interested in the future x240t. Are there any news on this? Will it have better resolution/quality than the x230t?