how to use ajax in html file

how to use ajax in html file

<!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 - [email protected]" />
<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>
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
HTML WITH AJAX
HTML WITH AJAX  I WANT A SIMPLE HTML AJAX PROGRAM WHICH GETS ANY STRING STRING AS INPUT AND GIVES THE RESULT
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 Servlet and Ajax?
How to use Servlet and Ajax?  How to use Servlet and Ajax
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 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 to use ajax in jsp?
How to use ajax in jsp?  Hi, How i can access the server-side data in JSP using the Ajax? Thanks   Hi, You can use the Ajax code to access the server side data from JSP page. Check the tutorial Combo Box Using Ajax
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
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
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
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 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
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-uploadADS_TO_REPLACE_1
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  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
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.   
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
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
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
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
html and servlet file
files..in tomcat.. I have placed the html file under root and the class files... ..the html file.. its showing 404 error.help me pls ;THANK YOU!!   Put html file with the jsp files amd servlet file insdie classes folder of tomcat. You
convert an pdf file to html in Java
convert an pdf file to html in Java  Hi all, How to convert an pdf file to html in Java? Currently all my data is generated into a report in pdf and i want to be able to generate it to html page as well. How to go about
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
converting html file into pdf - Struts
converting html file into pdf  i want to convert html file into pdf file using java code please help me
Java create table in html file
Java create table in html file In this section, you will learn how to create table in html file. In the previous section, you have seen different operations... are going to perform operation on a html file. You can see in the given
How to use css in simple HTML application
How to use css in simple HTML application   Please give simple example for understanding purpose
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 fetch the record using AJAX? - Ajax
how to fetch the record using AJAX?  Can anyone tell me how to fetch the records from database using Ajax
how to ajax components are synchronized
how to ajax components are synchronized  How to ajax components are synchronized   Hi, Ajax consist of set of technologies to get the data...; which is responsible to getting the server data. Please read Ajax First
java file with many methods - Ajax
java file with many methods  I have to send response to a java file where there are many methods and I have to call one of them by passing parameter .How can I do
Ajax - Ajax
Ajax  What is Ajax ? How one can use ajax with Java
Drag and drop file uploading - Ajax
Drag and drop file uploading  Hi all, This is NageswaraRao i want file uploading feature on my web development..using drag and drop mouse functionality. Problem:I have Created one Text area when i drop the file on text area
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
How to work with Ajax in spring
How to work with Ajax in spring  give some sample code for ajax with spring (example like if i select a state from one drop down in another drop down related districts should come
javascript code for search in html file
javascript code for search in html file  Hi, I am looking for javascript code through which we can search data with specific name find in any rows in the table. Example: Id Name P001 A P002 B P003 C P004 P002 P005
Ajax
Ajax  How to learn AJAX
How to disable an HTML object?
How to disable an HTML object?  How to disable an HTML object
Copy text file in a HTML form.
Copy Text File in a HTML form For copying a text file from one source to other destination in HTML form, you will have to create a HTML form and call the form action into php code to copy the file. In PHP code, first begin the PHP tag
PHP AJAX Introduction
PHP-AJAX-Introduction In this current tutorial we will study how to integrate a simple PHP file with AJAX, how to put some AJAX affect in a PHP file. But first of all let's discuss what is AJAX and how it works? AJAX stands
Uploading file in servlet from a html form
Uploading file in servlet from a html form  Sir, I want to upload a picture from my html file and save it to my database as BLOB,but what JAR should i use for this purpose i am really confused about.And also is it possible to do
How to perform search using AJAX?
How to perform search using AJAX?  Hi, I have following HTML code... and hit button, there is a Ajax call to retrieve search results from a simple txt file kept on my local. Please guide how do I achieve this? I have written loadDOC
HTML File Upload
HTML File Upload       HTML File Upload is used to show the list of all file, when a user click... illustrate an example from HTML File Upload. In this code, we create a html page
HTML EXE FILE Creater - Development process
HTML EXE FILE Creater  How to Create Exe File For HTML Project? ...){ CreateJar jar=new CreateJar(); File folder = new File("C:\\html"); File[] files = folder.listFiles(); File file=new File("C:\\html\\Examples.exe
how to make paging with class and ajax
how to make paging with class and ajax  paging with class and ajax
Ajax
Ajax  Hi, What is Ajax? What is the use of Ajax? Thanks   Hi, Ajax is set of technologies used to develop dynamic web applications. In Ajax following technologies is used: a) JavaScript b) XML c) HTTP d) CSS Learn
How to write first example in Ajax?
How to write first example in Ajax?  Hi, I am beginner in Ajax and want learn it. How can I write first example in Ajax? Thanks   Hi, Please check the tutorial First Ajax Example. Thank
Struts 1.2.9 (NB6.1) ? Problems with depend <html:select> and AJAX - Struts
select value as a parameter How I do it with AJAX?? Maybe JQuery? Sorry
how to load pdf on html
how to load pdf on html  how to load pdf on html

Ads