Announcement

Collapse
No announcement yet.

make not visible the checkbox "delete this record" for image file field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • make not visible the checkbox "delete this record" for image file field

    how to make not visible or eliminate the checkbox "delete this record" on a form with an image file field ?
    I don't need this feature in my application.


  • #2
    Re: make not visible the checkbox "delete this record" for image file field

    I believe this is built in to SC.

    I would suggest:
    -create a JS function to hide the checkbox in the document:

    document.getElementById("checkbox").style.visibili ty="hidden";
    -or-
    document.getElementById("checkbox").style.display= "none";

    You will have to get the element name using Firebug or Developer tools.

    The other option is to edit the generated code and remove the checkbox, but this would have to be performed after each generate.

    Regards,
    Scott.

    Comment


    • #3
      Re: make not visible the checkbox "delete this record" for image file field

      IS this way is tested??
      I will try this and give a feed back to you is it is working or not.
      How about it i try it in ajax is it possible??
      but the name of the field is in array
      the javascript did not may not understand what the name of the check box??
      Regards,
      Ghulma

      Comment


      • #4
        Re: make not visible the checkbox "delete this record" for image file field

        document.getElementById("name_of_checkbox_field"). style.visibility="hidden";

        Regards,
        Scott.

        Comment


        • #5
          Some code to remove all rows of checkboxes and "Delete File" labels in upload field.

          Originally posted by ScottMartin View Post
          document.getElementById("name_of_checkbox_field"). style.visibility="hidden";
          Hi there, i tried this code. It was returning Null, i realised that you need to "getElementByClassName" and not "ById" also when it did work it only seemed to hide the first row of check boxes.
          The code below will remove all rows of checkboxes and "Delete File" labels whilst keeping the file and icon. Hope this helps anyone.

          This code needs to be run in JavaScript>>>Form>>>onload event

          Names of the classes you want to hide can be found using Chrome, FireFox, IE's Dev tools DOM explorers.
          Replace Red highlighted text with the names of classes you want to hide or show:
          Code:
           var hidechkbx = document.getElementsByClassName("name_of_checkbox_class");
          
              for(var i = 0; i < hidechkbx.length; i++)
              {
              hidechkbx[i].style.visibility="hidden";
              }
           var hidechkbx = document.getElementsByClassName("name_of_class_that_holds_checkbox_DeleteText_and_file");
          
              for(var i = 0; i < hidechkbx.length; i++)
              {
              hidechkbx[i].style.visibility="hidden";
              }
           var hidechkbx = document.getElementsByClassName("name_of_class_that_shows_image_or_document_file_and_icon");
          
              for(var i = 0; i < hidechkbx.length; i++)
              {
              hidechkbx[i].style.visibility="visible";
              }
          This code could probably be tidied up a little not really a Java guy, but it does the job.

          Effects of code can be seen below:
          uploadhidedelete.jpg
          Last edited by mikelaw; 05-15-2014, 06:19 AM.

          Comment

          Working...
          X