Jump to content

Ingolme

Moderator
  • Content Count

    14,368
  • Joined

  • Last visited

  • Days Won

    95

Everything posted by Ingolme

  1. I'm not sure what your requirement is. How many lowercase characters does the password need? How many uppercase characters does it need? Does the order matter?
  2. What exactly are you trying to match with that regular expression? It looks unnecessarily complicated. There isn't a reason to use the RegExp constructor here either. What you're checking for with that expression is 199 strings of any length, even empty strings count, containing only the specified characters You just need to check for a minimum of one of each type of character. var val = myInput.value; // Check for lowercase letters var lowerCaseLetters = /[a-z]/; if(lowerCaseLetters.test(val)) { letter.classList.remove("invalid"); letter.classList.add("valid"); } else {
  3. When you wrap the code inside a function, it loses access to all of the variables that are outside of the function. You need to pass them into the function as function arguments.
  4. There is no way to know what is wrong without seeing your code. Most likely it's something to do with duplicate IDs.
  5. Ingolme

    Help me please

    Have a field in the money_transfer table with the ID of the user involved. I'm not sure if I understood the question since this is trivial.
  6. What you're asking to do is not commonly done. The menu almost always gets reloaded along with the rest of the page and there's no real drawback to that behavior. You can work around that by loading the page content with AJAX, but that's not very SEO friendly. While I advise against frames, I have to correct you on the fact that iframes are part of the HTML 5 specification.
  7. It's just mismatched parentheses on this line: var days = Math.floor(distance % (1000 * 60 * 60 * 24 * 7)) / (1000 * 60 * 60 * 24)); Count the opening brackets and the closing brackets.
  8. Synchronous requests are deprecated since they cause the browser to freeze, many browsers don't support them anymore. You have to give your request an onreadystatechange handler and put your code in there.
  9. PHP cannot read data from Javasrcript. PHP runs first on the server, then it generates Javascript code and that Javascript code runs after the PHP has already finished. If you want to send data from a Javascript program to PHP, you have to use AJAX.
  10. The request was that the page fades out when the user focuses the search bar but the search bar remains visible. Your code just covers the whole page with black when the user clicks a button.
  11. What error message? You must not declare it inside the loop. Only outside. It's been a while since I last programmed in C# so I don't remember if it requires variables to be initialized. If it does, just initialize it to an empty string. string userName4 = ""; It has to be done outside of the loop.
  12. My code should work as long as you keep the same CSS as before. Without that CSS, it won't hide the elements that should be filtered.
  13. Only <li> elements can be children of <ol> elements. Just wrap the image in <li> tags. <ol> <li>Allez dans le mneu <b>Démarrer</b>.</li> <li> Cliquez sur la roue crantée <b>Paramètres</b>. <figure> <img src="http://www.actunet.org/astuces/win10/images/44-1.jpg" alt="Démarrer et paramètres" > <figcaption>Fig.1 - Parametres</figcaption> </figure> </li> <li> dans <i>Paramètres</i>, cliquez sur <b>Système</b>. <img class="o
  14. You declare it outside of the loop and use it inside. string userName4; do { Console.WriteLine("User not found! Please re-enter your username"); userName4 = Console.ReadLine(); } while (userName4 != userName);
  15. I'd probably use a different approach. You'll need different code depending on whether you want to choose the intersection of the groups or the union of the groups, or you could have some radio options to choose either an intersection or a union. The general idea is that, when you change any of the options, you will run a function. In this function, you will loop through each of the elements, hide it if it does not meet the criteria, show it otherwise. Instead of using buttons, you will need checkboxes so that you can select more than one of them at a time without having to write too
  16. The problem is the semi-colon at the end of your if() statement on line 13. Your syntax highlighter has been kind enough to underline it in green to indicate that you probably don't want it there.
  17. I don't know where to begin in explaining how it's done. It is a big project. Part of learning programming is learning how to break requirements down into its components and identify how the components interact with each other. Even before that, you need to create very clear requirements. Write a document describing how the program should work in detail from a user's perspective. Without that document even I cannot write the software for you. What is the very first thing that the user sees when they land on the page? What buttons, pictures and text are there and how is the user meant to i
  18. You might want to search for a Wordpress plugin that aggregates all of your CSS files into one. Wordpress itself is a problem for page speed in general, but so are frameworks like Bootstrap and jQuery. A fast website should only have one CSS file and as little Javascript running while the page loads as possible.
  19. The W3Schools staff generally don't visit the forums, but they provide an email address where you can indicate problems with the site: help@w3schools.com You can find this email address on any page by clicking the "REPORT ERROR" link at the bottom of the page.
  20. W3Schools is correct and this is corroborated by MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDay On which day of the week are you getting a 7?
  21. All those new Javascript features are just syntactical sugar. Since they don't do anything particularly useful besides that, I generally don't use them since I prefer my websites to be accessible to the widest range of people. Now if Javascript introduced something useful like strict typing or passing primitive values by reference I'd be more in favor of pushing for new versions of Javascript.
  22. I'm not sure why this is in the HTML tutorial. These are Javascript APIs, not HTML APIs. In this context, the browser itself is the provider and your Javascript code is the client. The API is the interface through which you request data or a service from the browser.
  23. In your original code you seemed to be under the assumption that the argument name is the name of the function it should be calling, but that is not the case. The callback has to be passed in when the function is called and executed inside the body of the function. Your new code works without a problem, but it relies on test3 being in the global scope.
  24. Your example code does not make much sense. You first need to understand function arguments in general before learning about callbacks. The first thing to note is that the name of the argument does not matter and is completely unrelated to any variables or functions outside of the function that the argument belongs to. A callback is just a function that is passed as an argument. You then call it in the same way as you call any other function. // Declare functions function a(x) { x(); } function b() { alert("TEST"); } // Pass b as a callback to a. a(b);
×
×
  • Create New...