Jump to content

dalawh

Members
  • Content Count

    127
  • Joined

  • Last visited

Community Reputation

4 Neutral

About dalawh

  • Rank
    Member
  1. dalawh

    email validation

    So when ^ is inside [], it means not and when ^ is outside of [], it means the start? Without the i modifier, it will only accept the domain and tld in capitals right? Oh. What I mean was, was it better to use [A-Z] and true means valid email or [^A-Z] and false means valid email. Pretty much the same, but different ways of looking at it. I realized that the way mentioned was better.
  2. dalawh

    email validation

    Still in need of help from the generous members of the community
  3. dalawh

    email validation

    Thanks for the site. I think I will use this on: ^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$It seems to be the most accurate/useful one. Does the ^ apply to the whole expression or just the first []? I would assume the first []. On the site, it said: I may be misreading this, but does it say to use i as a modifier instead of adding a-z? If that is true, doesn't that affect the domain and tld meaning when I use test, it will always come back true since the domain and tld will always contain letters? When you use test function with the above expressions, how does it work? Does it only return one true/false or one for each of the []? For the domain and tld, wouldn't it be better to use ^ to prevent unwanted characters?
  4. I was looking through some ways to validate email. I saw the one on w3schools, but that is a basic one, so I started to code something more complicated adding all those if, else if, else statements, etc. Then I came across this... function validateEmail(email){var allowed=/^([a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$)/; return allowed.test(email);} Is something that simple sufficient enough? Everything seems to look as if it would work. Also, what does the "$" do?
  5. Oooo, did not know this. Thanks for this
  6. Oh stupid me. Thanks a lot for the help.
  7. I went over this plenty of times and no matter how many times I go over it, something goes wrong and I can't seem to figure it out. function validateEmail(email){var atNum=0;for(var i=0; i<email.length; i++){ //Checks for number of @ if(email.charAt(i)=="@"){ atNum++; }}alert("atNum: " + atNum);var atPos=email.indexOf("@");alert("atPos: " + atPos);var lastDotPos=email.lastIndexOf(".");alert("lastDotPos: " + lastDotPos);var user=email.substr(0,atPos);alert("user: " + user);var domain=email.substr(atPos+1,lastDotPos-1); //<-- ISSUEfor(var i=atPos+1; i<lastDotPos; i++){ alert("email.charAt(" + i + "): " + email.charAt(i));}alert("domain: " + domain);var tld=email.substr(lastDotPos+1,email.length-1);alert("tld: " + tld);return false;} This is not fully functioning. Every time I run this, the domain always displays like gmail.com instead of gmail. I even tried to set the lastDotPos-1 to something I know that is suppose to give me gmail, but it still comes out as gmail.com. What is wrong?
  8. Oh okay. I didn't know mods could unlock accounts, but I am glad to know that. If mods can unlock accounts, I have no need for admins I forgot my password so I thought I try to guess it, but my account got locked before I got over 2 tries. They haven't been active since last year... there is no e-mail... I don't understand where you are coming from. I love the 3 active mods. They help me out a lot.
  9. What I meant was that there are only 3 active mods and on the forums, there are a total of 5 mods and 3 admins. What happen to the other 2 mods and 3 admins?
  10. Thanks for explaining this. Makes much more sense.
  11. There needs to be more active admins. It seems none of them are active. Only 3 mods are active and the rest disappeared. What happened? There needs to be a way for users to contact admins to unlock their account when it gets locked. Since the admins are not active, doesn't that mean it will never get unlocked?
  12. dalawh

    Float and Center

    When I used a form and input, text-align:center did not work, but when I changed it to just buttons, it worked fine. Oh okay. I tried the same method and it was off a bit. Won't be needing it now, so it doesn't matter.
  13. I am not missing a semi colon at the end. Not really sure where you are getting at.
  14. dalawh

    Float and Center

    Wouldn't that make it not centered? You said the left margin was approx 25px and the right margin is 10px. It seems if I don't use form and use buttons instead, the text-align:center works fine.
  15. It works. Can you explain to me why this is happening?
×
×
  • Create New...