Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Editabillity of input fields

    General Discussion
    2
    6
    226
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dick Honing
      Dick Honing last edited by

      Is there an option to make an input field non editable? Preferably, I'm looking for a mechanism to turn the editabillty on and off.

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        Hello,

        Not related to AppDrag but more HTML/CSS/JS knowledges, in jQuery which is loaded on your AppDrag website you can do it this way :

        // disable
        $(".your-selector-to-target-your-input").attr("disabled","disabled");
        // enable
        $(".your-selector-to-target-your-input").removeAttr("disabled");
        

        (it works on all kind of inputs, dropdowns and textareas)

        1 Reply Last reply Reply Quote 0
        • Dick Honing
          Dick Honing last edited by

          @Wassim I finally got it to work. The main issue why this did not work earlier, is that I thought I was adding an ID to the input field through the Page Builder, whilst it was actually adding it to the surrounding element. I then went into the code and added id="ProductnaamInput to the input field manually. Finally, I added the following code to my onload routine:

              document.getElementById("ProductnaamInput").readOnly = true;
          

          and voila! 🙂

          And here is a definite feature request: being able ad a Cloud Backend (Indentification) ID to an input field via Page Builder!

          The idea is behind this, is that I can build a form which can display data in read only mode, which can then be edited by clicking a button and finally saved to the database.

          1 Reply Last reply Reply Quote 0
          • Wassim
            Wassim last edited by

            @Dick-Honing said in Editabillity of input fields:

            nding element. I then went into the code and added id="ProductnaamInput to the input field manually. Finally, I added the following code to my onload routine:

            I think selecting your input this way would be easier:

            $("#yourId input")
            
            1 Reply Last reply Reply Quote 0
            • Dick Honing
              Dick Honing last edited by

              @Wassim thanks for the tip! First I'm trying to learn Javascript basics and then I'll take a look ad jQuery ...

              1 Reply Last reply Reply Quote 0
              • Wassim
                Wassim last edited by

                You're welcome, it works in Vanilla Js too:

                 document.querySelector("#yourId input");
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post