DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2

Thread: Validation

  1. #1
    Alex Guest

    Validation


    Hi. My name is Alex. I just start study JavaScript and i trying to do some
    Project, but I have problem with this part of code . Please could you help
    me.
    <HTML>
    <HEAD>
    <script language="javaScript">

    function Chek@(txtobj)
    {
    var txtval=document.form1.txtobj.value;
    if(txtval=="")
    {
    alert(You have to insert your E-Mail);
    return false;
    }
    else
    for(var i; i<txtobj.value.length;i++)
    {
    var AT=txtobj.value.substring(i;i+1);
    if(AT=='@')
    { var AT1=AT;
    alert(AT1);
    }
    return true
    }
    }


    function Validation()
    {
    if (Chek@(document.form1.EMail))
    alert(successfull) return true;
    }


    function funshow()
    {
    window.open('SMOL.HTML', 'NAME', config='height=300,width=300')
    self.name="MAIN WINDOW"
    }

    </Script>
    </HEAD>
    <BODY>

    <form name="Form1">
    <p>Last Name: <input type="text" name="LName"></p> <br>
    First Name: <input type="text" name="FName"> <br>
    <p>DOB: <input type="text" name="DOB"></p> <br>
    <p>SSN: <input type="text" name="SSN"></p> <br>
    <p>Phon: <input type="text" name="Phon"></p> <br>
    <p>E-Mail: <input type="text" name="EMail"></p> <br>
    <p>Address: <input type="text" name="Address"></p> <br>
    <p>City: <input type="text" name="City"></p> <br>
    <p>State: <input type="text" name="State"></p> <br>
    <p>Zip: <input type="text" name="Zip"></p> <br>


    <INPUT TYPE="BUTTON" VALUE="SHOW" NAME="b" onClick=if (Validation())"funshow()"></Input>
    &ndsp; &ndsp;
    <input type="reset" value="Clear">

    </form>
    </BODY>
    </HTML>
    Thank you for answer.

  2. #2
    Paul Clapham Guest

    Re: Validation

    Okay, I see the code, so what's your problem?

    Alex <Sycale@yahoo.com> wrote in message news:3967a4d5$1@news.devx.com...
    >
    > Hi. My name is Alex. I just start study JavaScript and i trying to do

    some
    > Project, but I have problem with this part of code . Please could you help
    > me.
    > <HTML>
    > <HEAD>
    > <script language="javaScript">
    >
    > function Chek@(txtobj)
    > {
    > var txtval=document.form1.txtobj.value;
    > if(txtval=="")
    >


    > alert(You have to insert your E-Mail);
    > return false;
    > }
    > else
    > for(var i; i<txtobj.value.length;i++)
    > {
    > var AT=txtobj.value.substring(i;i+1);
    > if(AT=='@')
    > { var AT1=AT;
    > alert(AT1);
    > }
    > return true
    > }
    > }
    >
    >
    > function Validation()
    > {
    > if (Chek@(document.form1.EMail))
    > alert(successfull) return true;
    > }
    >
    >
    > function funshow()
    > {
    > window.open('SMOL.HTML', 'NAME', config='height=300,width=300')
    > self.name="MAIN WINDOW"
    > }
    >
    > </Script>
    > </HEAD>
    > <BODY>
    >
    > <form name="Form1">
    > <p>Last Name: <input type="text" name="LName"></p> <br>
    > First Name: <input type="text" name="FName"> <br>
    > <p>DOB: <input type="text" name="DOB"></p> <br>
    > <p>SSN: <input type="text" name="SSN"></p> <br>
    > <p>Phon: <input type="text" name="Phon"></p> <br>
    > <p>E-Mail: <input type="text" name="EMail"></p> <br>
    > <p>Address: <input type="text" name="Address"></p> <br>
    > <p>City: <input type="text" name="City"></p> <br>
    > <p>State: <input type="text" name="State"></p> <br>
    > <p>Zip: <input type="text" name="Zip"></p> <br>
    >
    >
    > <INPUT TYPE="BUTTON" VALUE="SHOW" NAME="b" onClick=if

    (Validation())"funshow()"></Input>
    > &ndsp; &ndsp;
    > <input type="reset" value="Clear">
    >
    > </form>
    > </BODY>
    > </HTML>
    > Thank you for answer.




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links