Skip to main content

SCRIPT VALIDATION

<script>
function checknull()
{

if(document.query.name.value=="")
{
 alert('Please Enter Name');
  document.query.name.focus();
 return false;
}

var x=document.forms["query"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }

/*
if (document.query.mobile.value=="")
{
 alert('Please Enter Mobile No.');
 document.query.mobile.focus();
 return false;
}

*/
//if ((document.query.mobile.value=="") || (isNaN(document.query.mobile.value)) || (document.query.mobile.value.length!=10))

if (document.query.mobile.value=="" || isNaN(document.query.mobile.value) || document.query.mobile.value.length!=10)
{
 alert('Please Enter Mobile No.');
 document.query.mobile.focus();
 return false;
}




if (document.query.city.value=="")
{
   alert('Please Enter City Name');
      document.query.city.focus();
 return false;
}

if(document.query.course.value=="")
{
 alert('Please Enter Course Name');
 document.query.course.focus();
 return false;
}

if(document.query.message.value=="")
{
 alert('Please Enter Your Query');
 document.query.message.focus();
 return false;
}

alert("Thank you for showing intrest in us. Shortly You will get call from us.");
}
</script>
</head>

<body>
<table width="225" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center"><table width="225" height="400" border="0" cellpadding="0" cellspacing="0" background="images/roundcornertopbg2.jpg">
      <tr>
        <td width="270" align="center" valign="top" class="style35"><table width="220" height="90" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#DFDBDA">
            <tr>
              <td><img src="images/caller.jpg" width="220" height="90" border="0" /></td>
            </tr>
          </table>
            <form action="addenquiry.php" method="post" name="query" id="query" onsubmit="return checknull();">
              <table width="200" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <td align="left" class="style14"><span class="style36">Name</span><br />
                        <input name="name" type="text" class="formborder" id="name" size="26" />
                    </td>
                  </tr>
                  <tr>
                    <td align="left"><span class="style37">E-Mail</span><br /> <span class="style229">
                      <input name="email" type="text" class="formborder" id="email" size="26" />
                      </span></td>
                  </tr>
                  <tr>
                    <td align="left"><span class="style229"> <span class="style14">Mobile No. </span><br />
                          <input name="mobile" type="text" class="formborder" id="mobile" size="26" />
                    </span></td>
                  </tr>
                  <tr>
                    <td align="left"><span class="style229"> <span class="style14">City</span><br />
                          <input name="city" type="text" class="formborder" id="city" size="26" />
                    </span></td>
                  </tr>
                  <tr>
                    <td align="left" width="66%"><span class="style229"> <span class="style14">Interested Course </span><br />
                          <input name="course" type="text" class="formborder" id="course" size="26" />
                    </span></td>
                  </tr>
                  <tr>
                    <td align="left" width="66%"><span class="style229"> <span class="style14">Query</span><br />
                          <textarea name="message" cols="23" rows="2" class="formborder" id="message" style="font-family:arial;font-size:10pt"></textarea>
                    </span></td>
                  </tr>
                  <tr>
                    <td align="left"><span class="style229">
                      <label>
                      <input name="mobilealert" type="radio" value="yes" checked="checked" />
                      <span class="style128">Agree to recieve Call / Mail</span></label>
                    </span></td>
                  </tr>
                  <tr>
                    <td align="left"><span class="style229">
                      <input type="submit" name="Submit2" value="Submit">
                    </span></td>
                  </tr>
                </tbody>
              </table>
            </form></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30">&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><table width="200" height="250" border="0" cellpadding="5" cellspacing="0" background="images\bg4.jpg" bgcolor="#666666">
      <tr>
        <td valign="top"><p align="center" class="style19 style48">Speak to our career counsellors to know best career options for you based on your potentiality. </p>
            <table width="180" height="100" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td align="center" valign="middle"><marquee height="80" direction="up" scrollamount="1" loop="-1">
                  <span class="style175">Call : 7303 73 0033 </span>
                  </marquee>
                </td>
              </tr>
          </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<br />
<br />
</body>
</html>

Comments

Popular posts from this blog

LECTURE BREAKUP OF PHP MYSQL

PHP+MYSQL Introduction Basic Syntax Variable & it's Scope I/O & Comment   String & it's Function Operator & Expression Decision Control Case Control Loop Control Arrays & Function Form Handling State Management - Cookies State Management - Session Mail Concept Working with File Date/Time Functions Introduction MySQL Environment Database Concept Datatype Query processing Statements  Query processing based on condition Database Connectivity Database Operation With GUI Import/Export Database

OOP IN VB 6.0

Visual Basic 6.0 supports object-oriented language elements and has support for objects distributed in libraries.   Object Oriented Programming is quite simple and provides way to modularize program by creating partition memory area for both data & function than can be used as template for creating copies of such module. In the world of OOP , you break a problem down into small parts and solve them individually. OOP is good for large-scale programming - As your code grows large, there are going to be more and more procedures/functions to your program, and your code is going to be so cluttered that one more look at it, you'd scream. Class In Visual Basic 6.0, a class is defined in a class module. A single class module is stored in a special type of file that has a .cls file extension. In Visual Basic 6.0, the class   Initialize   event handler named   Class_Initialize   is used to execute code that needs to be executed at the moment that an...

SELECT | INSERT | UPDATE | DELETE CODE IN VB.NET WITH AUTO INCREMENT CONCEPT

Database.vb Imports System.Data.SqlClient Public Class Database     Dim con As New SqlConnection( "Data Source=G20;Initial Catalog=Me;Integrated Security=True" )     Public Sub cnopen()         If con.State = ConnectionState.Open Then             con.Close()         End If         con.Open()     End Sub     Public Sub cnclose()         If con.State <> ConnectionState.Closed Then             con.Close()         End If     End Sub     Public Function Displaygrid( ByVal query As String ) As DataTable         Dim dt As N...