What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

button situation?

joaosiltatv

New member
Joined
Dec 21, 2021
Messages
3
Reaction score
0
HTML Coins
0
Hi guys. I'm need at coding and I'm in a volunteer project and we need to build a website. I'm losing my mind with things that probbaly it's very very easy.

Ao, one of my problems is: I want to create like a form, with a minimum of 100 characters. When the person writes less that 100, appears a message saying that the person needs to write more (and the button is disable). When the person writes 100 or more, the button gets available and they can submit the form. (and then go like back to the home page).

Hopefully someone can help me. Thank you in advance.
 

Attachments

  • Screenshot_2.png
    Screenshot_2.png
    6.9 KB · Views: 4
  • Screenshot_3.png
    Screenshot_3.png
    25.1 KB · Views: 4
Hi guys. I'm need at coding and I'm in a volunteer project and we need to build a website. I'm losing my mind with things that probbaly it's very very easy.

Ao, one of my problems is: I want to create like a form, with a minimum of 100 characters. When the person writes less that 100, appears a message saying that the person needs to write more (and the button is disable). When the person writes 100 or more, the button gets available and they can submit the form. (and then go like back to the home page).

Hopefully someone can help me. Thank you in advance.
One way of fixing it is by adding
JavaScript:
function loop() {
    if(document.getElementById("escrevertexto").value.length>=100)    {
        document.getElementById("button-57").disabled=false;
    }
    else    {
        document.getElementById("button-57").disabled=true;
    }
    setTimeout(loop, 0);
}
loop();
which checks every millisecond making sure that the form is valid and enabling the button, if not it disables the button.
 
Last edited:
You can do the same thing using the "KEYUP" event and a data attribute.

KeyUP events are fired immediately.

Code:
<input type="text" name="" id="escrevertexto" data-min-length="100" />
<button id="button-57" disabled="disabled">Submit</button>

<script>
    document.querySelector("#escrevertexto").addEventListener("keyup", (el) => {
        document.querySelector("#button-57").disabled = el.currentTarget.value.length <= el.currentTarget.dataset.minLength;
    });
</script>
 
Another way to build software https://mlsdev.com is to use predefined components. Depending on the scope of your project, this is important for your budget. In addition, you can use different kinds of software for different applications. For example, if you need to create a website for your company, you can use PHP. The PHP coder will need to know CSS as a style guide. It is a common language that allows you to design a variety of applications.
 
Last edited:

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back