Activity Stream
48,167 MEMBERS
6746 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1.     
    #11
    Member
    Website's:
    imdber.org justpaste.me
    You should practise indenting your code (and adding comments), it makes your code readable.

  2.   Sponsored Links

  3.     
    #12
    Member
    Website's:
    TeamUploads.com GamerW.net
    thanks buddy for your idea i am trying it my self alot actually i love PHP and have knowledge about PHP, i totally forget javascript thats why i am asking here for help.

  4.     
    #13
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by sahil00150 View Post
    i never tried reg ex
    The only thing which is remain is character counting how much letter submitted in input box.

    alert box must show counted characters + valid or invalid email + message



    Code: 
    <html>
    <head>
    <script type="text/javascript">
    function CheckMyEmail()
    {
    var x=document.forms["myForm"]["email"].value;
    var value=("BC102034568");
    var at=x.indexOf("@");
    var dot=x.lastIndexOf("vu.edu.pk");
    if (at<1 || dot<at+1 || dot+2>=x.length)
    {
    alert( x + " is Not your valid VU e-mail address");
    return false;
    }
    else
    {
        if(x=="BC102034568@vu.edu.pk")
            {
            alert( x + " is your valid VU e-mail address");
            return false;
            }
    else
    {
    alert( x + " is not an valid email address");
    return false;
    }
    }
    }
    </script>
    </head>
    
    <body>
    <form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">
    Email: <input type="text" name="email">
    <input type="submit" value="Submit">
    </form>
    </body>
    
    </html>
    you again forgot to make return function well i done it.

    if someone submit more then 40 characters email the alert box show email it too much large of some one enter minimum characters like 2 or 3 character alertbox must show email characters are less.
    PHP Code: 
    if (x.length >= 40) {
    alert("Too much");
    } else if(
    x.length =< 3) {
    //ahh;
    alert("Too Less");
    } else {
    //ok;


  5.     
    #14
    Member
    Website's:
    TeamUploads.com GamerW.net
    but how i can implement your code in fields ?

    Code: 
    if (x.length >= 40) {
    alert("Too much");
    } else if(x.length =< 3) {
    //ahh;
    alert("Too Less");
    } else {
    //ok;
    } 

  6.     
    #15
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Before checking any other checks
    PHP Code: 
    <html>
    <
    head>
    <
    script type="text/javascript">
    function 
    CheckMyEmail()
    {
    var 
    x=document.forms["myForm"]["email"].value;

    if (
    x.length >= 40) {
    alert("Too much");
    } else if(
    x.length =< 3) {
    //ahh;
    alert("Too Less");
    } else {
    //ok;
    var value=("BC102034568");
    var 
    at=x.indexOf("@");
    var 
    dot=x.lastIndexOf("vu.edu.pk");
    if (
    at<|| dot<at+|| dot+2>=x.length)
    {
    alert" is Not your valid VU e-mail address");
    }
    else
    {
        if(
    x=="BC102034568@vu.edu.pk")
            {
            
    alert" is your valid VU e-mail address");
            return 
    true;
            }
    else
    {
    alert" is not an valid email address");
    }
    }
    }
    return 
    false;


    </script>
    </head>

    <body>
    <form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">
    Email: <input type="text" name="email">
    <input type="submit" value="Submit">
    </form>
    </body>

    </html> 

  7.     
    #16
    Member
    Website's:
    TeamUploads.com GamerW.net
    Not worked.............

  8.     
    #17
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Ahh, yeah, a small type in the comparison operator: =<
    PHP Code: 
    <html>
    <
    head>
    <
    script type="text/javascript">
    function 
    CheckMyEmail()
    {
    var 
    x=document.forms["myForm"]["email"].value;

    if (
    x.length >= 40) {
    alert("Too much");
    } else if(
    x.length <= 3) {
    alert("Too Less");
    } else {
    //ok;
    var value=("BC102034568");
    var 
    at=x.indexOf("@");
    var 
    dot=x.lastIndexOf("vu.edu.pk");
    if (
    at<|| dot<at+|| dot+2>=x.length)
    {
    alert" is Not your valid VU e-mail address");
    }
    else
    {
        if(
    x=="BC102034568@vu.edu.pk")
            {
            
    alert" is your valid VU e-mail address");
            return 
    true;
            }
    else
    {
    alert" is not an valid email address");
    }
    }
    }
    return 
    false;


    </script>
    </head>

    <body>
    <form name="myForm" action="example.html" onsubmit="return CheckMyEmail();" method="post">
    Email: <input type="text" name="email">
    <input type="submit" value="Submit">
    </form>
    </body>

    </html> 

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [WordPress] How to do this in javascript/php?
    By thizzladen in forum Web Application/Script Support
    Replies: 0
    Last Post: 16th Mar 2012, 12:05 AM
  2. Partner for making a stream / money making site.
    By S?nic in forum Community Cooperative
    Replies: 21
    Last Post: 6th Jan 2012, 10:39 PM
  3. [Hiring] 50 $ for making Javascript addon exactly like this ( latest posts )
    By TheTorrentSeller in forum Completed Transactions
    Replies: 6
    Last Post: 1st May 2011, 05:45 PM
  4. Need Javascript Help
    By Netguy in forum Web Development Area
    Replies: 7
    Last Post: 19th Mar 2011, 03:24 PM
  5. Help About JavaScript
    By macypro in forum Technical Help Desk Support
    Replies: 1
    Last Post: 7th Dec 2010, 12:23 AM

Tags for this Thread

BE SOCIAL