Click here to Skip to main content
15,886,066 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
<html>
<head>
<title>Employee Regitration Form</title>
<style type="text/css">
    .container {
        width: 500px;
        clear: both;
    }
    .container input {
        width: 100%;
        clear: both;
    }

    </style>


<link rel = "stylesheet" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>

<script type="text/javascript" src="jquery.validate.min.js"></script>

<script type="text/javascript"> $(document).ready(function(){ $("#subForm").validate(); }); </script>









<link rel="stylesheet" href="jquery-ui.css">
<script src="jquery-1.10.2.js"></script>
<script src="jquery-ui.js"></script>


<script type="text/javascript">
$(function() {
$( "#datepicker" ).datepicker();
});


$(document).ready(function ()
{

  $("#btnExport").click(function ()
{

  $("#tblExport").btechco_excelexport
({
 containerid: "tblExport"
, datatype: $datatype.Table
 });

  });

   });

function validate()
{
   if( document.myForm.Name.value == "Default" )
   {
     alert( "Please provide your name!" );
     document.myForm.Name.focus() ;
     return false;
   }
else if( document.myForm.EMail.value == "" )
   {
     alert( "Please provide your Email!" );
     document.myForm.EMail.focus() ;
     return false;
   }
  else if( document.myForm.Empnum.value == "" ||
           isNaN( document.myForm.Empnum.value ) ||
           document.myForm.Empnum.value.length != 6 )
   {
     alert( "Please provide a valid employee number" );
     document.myForm.Empnum.focus() ;
     return false;
   }
   else if( document.myForm.LeaveType.value == "Default" )
   {
     alert( "Please provide your LeaveType!" );
     return false;
   }
else
   return( true );
    alert( "Success!" );
}

</script>


</head>
<body>


 <form  name="myForm" action=Success.html style="background-color:#E6E6FA" align="center" >
 <table align="center" id="tblExport" cellspacing="2" cellpadding="2" border="1">
 <tr>
   <td align="right">Name</td>
   <td><select name="Name">
<option value="Default">Default</option>
<option value="Sudharsan">Sudharsan</option>
<option value="Bhargav">Bhargav</option>
<option value="Vishnu">Vishnu</option>


 </select>


</td>
 </tr>
 <tr>
   <td align="right">EMail</td>
   <td><input type="text" name="EMail" /></td>
 </tr>
<tr>
<script language="JavaScript" src="ts_picker.js"> </script>
   <td align="right">Date</td>
   <td><input type="text" name="timestamp" id="datepicker" value="" />
<a href="java<!-- no -->script:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="C:\Users\605061161\Desktop\Sudharsan doc\Palani.proj\datepick\cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a>
</td>
 </tr>

 <tr>
   <td align="right">Empnum</td>
   <td><input type="text" name="Empnum" /></td>
 </tr>
 <tr>
 <td align="right">LeaveType</td>
 <td>
 <select name="LeaveType">
   <option value="-1" selected>[choose yours]</option>
   <option value="1">Sick Leave</option>
   <option value="2">Casual Leave</option>
   <option value="3">Earned Leave</option>
   <option value="3">Flexy</option>
 </select>
 </td>
 </tr>
 <tr>
 <td align="right"></td>
 <td><input type="submit" value="Submit" /></td>

 <input type="button" name=save value="Save" >
 </tr>
 </table>


 </form>



 </body>
 </html>
Posted
Comments
Sergey Alexandrovich Kryukov 17-Jun-15 2:07am    
You need another tag. As I understand, "JavaScript".
But why doing such things in JavaScript, on client side?
—SA

1 solution

Please see http://excelbuilderjs.com[^].

This is another alternative: https://github.com/SheetJS/js-xlsx[^].

I don't feel like doing it in JavaScript is a good idea. It could require too much effort, not so easy to debug, all code is exposed to the anyone on the Web, and so on. Doing it on the server side, using one or another server-side technology would be much more reasonable task. And it would be especially natural to do in .NET, because you could use Microsoft Open XML SDK, so ASP.NET would be the most suitable server-side technology.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900