Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Ajax how to use ajax in html file
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


salim
how to use ajax in html file
0 Answer(s)      2 years and 7 months ago
Posted in : Ajax


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta name="Description" content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Erwin Aligam - ealigam@gmail.com" />
<meta name="Robots" content="index,follow" />       

<link rel="stylesheet" href="images/telecom.css" type="text/css" />

<title>BluePigment</title>
<script type="text/javascript">
        function validate()
        {
            //Name validation
            var a=document.frm.name.value;
            if(a=="")
            {
                alert("Please enter the name");

                return false;
            }
            if(!isNaN(a))
            {
                alert("Please enter the correct name");

                return false;
            }
            if(a.length > 25)
            {
                alert("Please enter name less than 25 characters");

                return false;
            }

            //License validation
            var b=document.frm.licence.value;
            if(b=="")
            {
                alert("Please enter the License number");

                return false;
            }
            if(isNaN(b))
            {
                alert("Please enter the correct Licence number");

                return false;
            }

            //Address validation
            var c=document.frm.address.value;
            if(c=="")
            {
                alert("Please enter the address");
                return false;
            }

            //Contact validation
            var d=document.frm.cno.value;
            if(d.length!=10 )
            {
                alert("Please enter valid contact number");
                return false;
            }

            if(isNaN(d))
            {
                alert("Please enter valid contact number");
                return false;
            }

            //Email-id validation
            var e=document.frm.email.value;
            if((e.indexOf("@")==-1) || (e.indexOf(".")==-1))
            {
                alert("Please Enter valid Email-id");
                return false;
            }

            if((e.indexOf("@")!=e.lastIndexOf("@"))||(e.lastIndexOf(".")-e.indexOf("@")<=2))
            {
                alert("Please Enter valid Email-id");
                return false;
            }

            //DOB validation
            var f=document.frm.date.value;
            if(f=="")
            {
                alert("Please enter valid date");
                return false;
            }



            alert("You have submitted data successfully.");
            return true;
        }

</script>   
</head>

<body>

    <!-- header starts here -->
    <div id="header"><div id="header-content">  

        <h1 id="logo-text"><a href="index.html" title="">Telecom<span>Inventory</span><span>Store</span></a></h1>   
        <h2 id="slogan">One Roof For All...</h2>        

        <div id="header-links">
            <p>
                <a href="index.html"></a> 
                <a href="index.html"></a> 
                <a href="index.html"></a>           
            </p>        
        </div>  

    </div></div>

    <!-- navigation starts here -->
    <div id="nav-wrap"><div id="nav">

        <ul>
            <li><a href="home.html">Login</a></li>
            <li id="current"><a href="retailerRegistration.html">Retailer Registration</a></li>
            <li><a href="imRegistration.html">IM Registration</a></li>
            <li><a href="index.html"></a></li>
            <li><a href="index.html"></a></li>          
        </ul>
    </div></div>

    <!-- content-wrap starts here -->
    <div id="content-wrap"><div id="content">    

        <div id="sidebar" > 

            </div>

        <div id="main">     

            <div class="box">

                <a name="TemplateInfo"></a>             
                <h1><a href="index.html">Welcome <span class="white">Retailer</span></a></h1>


            </div>          

            <div class="box">

                <a name="SampleTags"></a>
                <h1><a href="index.html"><span class="white">Retailer</span> Registration</a></h1>

                <h3></h3>

                <form name="frm" method="get" action="InsertServlet" onsubmit="return validate()">      
                    <p>
                        <label>Name</label>
                        <input name="name"  type="text" placeholder="Name" size="30" />
                        <label>Licence Number</label>
                        <input name="licence"  type="text" placeholder="License Number" size="30" />
                        <label>Address</label>
                        <textarea name="address" placeholder="Address" rows="1" cols="3"></textarea>
                        <br />
                          <label>Contact Number</label>
                        <input name="cno"  type="text" placeholder="Contact Number" size="30" />


                        <label>Email</label>
                        <input name="email"  type="text" placeholder="Email id" size="30" /><br/><br/>

                    <label>Date of Birth</label>
                        <input type="text" name="date" size=10 placeholder="dd" maxlength=10/>


                        <br/><br/>



                        <input name="registerR" class="button" type="submit" value="Register" />    
                        <input class="button" type="reset" value="Cancel"/>
                    </p>        
                </form> 

            </div>          

            <br />              

        </div>          


    <!-- content-wrap ends here -->     

    </div></div>

    <!-- footer starts here-->      
    <div id="footer-wrap">

        </div>  
        <font size=2>
        <div id="footer-bottom">        
            <p>

            © 2012-2013 Tata Consultancy Services Limited. All Rights Reserved
            </p>        
        </div>  
        </font>

<!-- footer ends-->
</div>

</body>
</html>

Advertisement
View Answers

Related Tutorials/Questions & Answers:
how to use ajax in html file
how to use ajax in html file  <!DOCTYPE html PUBLIC "-//W3C//DTD...; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <..." /> <meta http-equiv="Content-Type" content="text/html; charset
How to use Servlet and Ajax?
How to use Servlet and Ajax?  How to use Servlet and Ajax
Advertisements
How to Open a File in HTML Form
How to Open a File in HTML Form  Hi, My question in that how could i open a file in HTML Form. Could any one suggest me the examples or online help... it. Otherwise take this examples and syntax that will show how to Open a file in HTML
How to use css in simple HTML application
How to use css in simple HTML application   Please give simple example for understanding purpose
HTML WITH AJAX
HTML WITH AJAX  I WANT A SIMPLE HTML AJAX PROGRAM WHICH GETS ANY STRING STRING AS INPUT AND GIVES THE RESULT
how to fetch values from .properties to a html file
how to fetch values from .properties to a html file  I have a .properties file with some key value pairs in it. I need to fetch the values from this .properties file into a html file.Please let me know how to do
how can i use ajax and jquery in netbeans ide
how can i use ajax and jquery in netbeans ide  i am using .net here we hav to download ajax controls and if i use netbeans ide and uses ajax control so from where i can get these controls.also i want to know which struct book i
PHP/HTML/AJAX Question
PHP/HTML/AJAX Question  I have a PHP/HTML program that sends a parm to a .JS program using Ajax logic (onchange) and it returns it. It returns it as a HTML var but I need it as a PHP $var. How do I get it to into a $var and where
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt...://java.sun.com/JSP/Page" version="2.0"> <jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/> <html locale="true"> <head>
how to create own tld and use it in jspx file
how to create own tld and use it in jspx file  I wanted to add fmt...://java.sun.com/JSP/Page" version="2.0"> <jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/> <html locale="true"> <head>
how to use javascript drag and drop files upload - Ajax
how to use javascript drag and drop files upload  Hi,Sir Please, I... have asked to you similar problem recently.You answer to me to use java applet...; ------------------------------------------------- Visit for more information. http://www.roseindia.net/html
How to save form data to a csv file using jquery or ajax
How to save form data to a csv file using jquery or ajax  Please let..., Thank you for your reply , i am suppose to use only jquery or ajax for doing...=data.responseText; Now the problem is ,i should write form data to a csv file using ajax
Should i use Ajax? - Ajax
Should i use Ajax?  When a Ajax can be used in programming?  Its completely up to you but there is no harm in using Ajax programming... not to implement it on every page but you can use it on pages which is having more hits
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java   reading the data from Html file
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java
how to convert doc file into html using java swing
how to convert doc file into html using java swing  i want to convert doc file into html and display it on jtextarea please help me and give the sample code
How to send data by ajax to servlet? - Ajax
How to send data by ajax to servlet?  Hi, Can i send a value from a HTML file to servlet via Ajax? If it is possible please give me a sample code Thanks
how to use Excel Template to write excel file using java
how to use Excel Template to write excel file using java  How to use Excel template to write data in that file using java
how to use Excel Templet to write excel file using java.
how to use Excel Templet to write excel file using java.  how to use Excel Templet to write excel file using java
how do i allow users to download a xls file in html?
how do i allow users to download a xls file in html?  can anyone help me to allow users to download a xls file in html? i tried with href="path/filename.xls"click here but it works in chrome but not in mozilla.   
html login page with ajax
html login page with ajax  hi all... i want to create a login page using html and ajax for validation is must. please help me doing that with code... and password from the user and check whether the user is valid or not by using ajax
File uploading - Ajax
File uploading  hi friends, how to uploading the file by using "AJAX".Please send the complete source code for this application   where u want to store the file Can u specify
how to save html form data into .csv file using only jsp.
how to save html form data into .csv file using only jsp.  Dear all, I am developing a website only using jsp and html. i need to save the form data into a .csv file using jsp. can anyone give me any sample solution or tutorial
filter and display html table data using ajax - Ajax
on DisplayCategory.jsp in the form of the html table using responseText. how to do...filter and display html table data using ajax  Hi i am stuck up at a situation where i have a jsp page from where the control goes to the .js file
AJAX file upload
AJAX file upload If you want to upload file asynchronously means without... files. URL for Code http://www.webtoolkit.info/ajax-file-upload.html Demo URL http://www.webtoolkit.info/demo/ajax-file-upload Description
Ajax File Upload Example
Ajax File Upload Example       This application illustrates how to upload a file using servlet through the Ajax technology. In this example you simply create a file
Ajax file upload
Ajax file upload  I am developing a application for image upload using ajax and servlet. The image should be converted in byte[] and must be saved in oracle databse as blob. After uploading the image it should be displayed
jar file with html
jar file with html  I have a jar file. On double click it shows an applet page. Please tell me how to connect that applet into html or jsp page
How to use JAR file in Java
to digitally sign the JAR file. Users who want to use the secured file can check... do not use JAR file, then they will have to download every single file one... in JAR files, then you just need to download one single file and Run it. When you
Opening a file in a HTML form
Opening a file in a HTML form In this example, you will first see that a form has been created in HTML format and the code of opening a file has been written separately.  First create a HTML form and call the php action file to open
passing file parameter through ajax - Ajax
passing file parameter through ajax  I have file parameter in jsp file, i need to pass it to server side through ajax. how i can i do that.  ... for the server side, in which only file name we are getting. but how can i download
 

 

 

DMCA.com