Posts by Matheus Battisti • 101 points
7 posts
-
0
votes4
answers4310
viewsA: Enter key do not give Submit
Alternative with pure Javascript: document.addEventListener("keydown", function(e) { if(e.keyCode === 13) { e.preventDefault(); } }); In the first line we are adding an event of keydown to the…
-
0
votes5
answers16269
viewsA: How to enable a button only when all inputs are completed?
Alternative with pure Javascript HTML form: <form action="" id="form"> <input type="text" placeholder="Digite seu nome"> <input type="text" placeholder="Digite seu sobrenome">…
-
3
votes9
answers27569
viewsA: How do I read Javascript URL values (Querystring)?
I looked up this same question in the English forum, and in this topic, has a very simple solution through an object called Urlsearchparams The use is as follows:: const urlParams = new…
-
1
votes8
answers95476
viewsA: How to check with jQuery if there is a checkbox checked?
The question is about jQuery, but I believe it fits an alternative with pure Javascript: const checkbox = document.querySelector("#checkbox"); if(checkbox.checked === true) { console.log("Está…
-
1
votes5
answers14927
viewsA: How to not allow a character to be typed in the textbox, with Javascript/jQuery?
An alternative with pure Javascript: const input = document.querySelector("#input"); input.addEventListener("keypress", function(e) { if(e.key === ",") { e.preventDefault(); } }); In this example,…
-
0
votes0
answers35
viewsQ: Difference in performance of an application with similar scenarios
This weekend we deployed an application based on the Magento framework, which has been thoroughly tested in various scenarios, with high load of users making various requests to the database, such…
-
5
votes1
answer98
viewsQ: A user model should have all the actions that involve it?
Whenever I research I see that in MVC we should separate well the models so that it becomes more organized and easy for a next developer to understand the system. I have basic actions like login,…