below is the code.
Thanks,
Expand|Select|Wrap|Line Numbers
- <?xml version = "1.0" encoding = "utf-8"?>
- <!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">
- <head>
- <title>Incredible Roadside Assistance® - Products</title>
- <object id = "Product"
- classid = "CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83">
- <!--supply file location and name-->
- <param name = "DataURL" value = "Products.txt" />
- <!--specify whether first row is a header-->
- <param name = "UseHeader" value = "TRUE" />
- <!--denote the data field start and end -->
- <param name = "TextQualifier" value = "*" />
- <!--denote the field delimiter-->
- <param name = "FieldDelim" value = "|" />
- </object>
- <script type = "text/javascript">
- function submitForm( )
- {
- alert("submit");
- var fileSysObj = new ActiveXObject("Scripting.FileSystemObject") ;
- var textFile = fileSysObj.CreateTextFile("Order.txt", true) ;
- var qty="";
- alert( getText(document.getElementById("qty")) );
- textFile.WriteLine("total") ;
- textFile.Close( ) ;
- window.alert("A file has been created.") ;
- }
- function getText(el)
- {
- if (el.textContent) return el.textContent;
- if (el.innerText) return el.innerText;
- return el.innerHTML.replace(/<[^>]*>/g,'');
- }
- function resetForm( )
- {
- //set event's return value to false to override its default behavior
- window.event.returnValue = false ;
- //display a msgbox with OK and Cancel buttons on it
- if (confirm("Are you sure you want to clear the form?"))
- {
- //let the default behavior occur
- window.event.returnValue = true ;
- }
- else
- {
- //do nothing
- }
- }
- function createFile( )
- {
- }
- //]]>
- </script>
- </head>
- <body style = "background-color: bisque">
- <form id="form1" onsubmit= "submitForm( )" onreset="resetForm( )" action=" ">
- <h1 style = "text-align:center">Incredible Roadside Assistance® - Product Information</h1>
- <div style = "text-align: center">
- <select onchange = "Product.Sort = this.value; Product.Reset( ); ">
- <!--sort by Product ID data field in ascending order-->
- <option value = "ProdID">Product ID - Ascending</option>
- <!--sort by Product ID data field in descending order-->
- <option value = "-ProdID">Product ID - Descending</option>
- <!--sort by Product Name data field in ascending order-->
- <option value = "ProdName" selected>Product Name - Ascending</option>
- <!--sort by Product Name data field in descending order-->
- <option value = "-ProdName">Product Name - Descending</option>
- <!--sort by Product Desc data field in ascending order-->
- <option value = "ProdDesc">Product Description - Ascending</option>
- <!--sort by Product Desc data field in descending order-->
- <option value = "-ProdDesc">Product Description - Descending</option>
- </select>
- </div>
- <p>
- <span style = "background-color: bisque; position: absolute;
- margin-left: 15%; width: 67%; border-style: ridge; text-align: center;
- padding: 1em">
- <table id="myTable" datasrc = "#Product" >
- <thead>
- <tr>
- <th>Product ID</th>
- <th>Product Name</th>
- <th>Description</th>
- <th> </th>
- <th>Qty</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <span datafld = "ProdID">Product ID goes here.</span>
- </td>
- <td>
- <span datafld = "ProdName">Name goes here.</span>
- </td>
- <td>
- <span datafld = "ProdDesc">Description goes here.</span>
- </td>
- <td>
- <span>
- <img datafld = "Image" alt="Image goes here."></img>
- </span>
- </td>
- <td>
- <span>
- <select ID="qty" Name="qty" onchange = "Product.Sort = this.value; ">
- <option value = "0">0</option>
- <option value = "1">1</option>
- <option value = "2">2</option>
- <option value = "3">3</option>
- <option value = "4">4</option>
- <option value = "5">5</option>
- <option value = "6">6</option>
- <option value = "7">7</option>
- <option value = "8">8</option>
- <option value = "9">9</option>
- <option value = "10">10</option>
- </select>
- </span>
- </td>
- </tr>
- </tbody>
- </table>
- <table>
- <tr>
- <td>
- <input type="submit" id="btnSubmit" value="Submit" />
-
- <input type="reset" id="btnCancel" value="Cancel" />
- </td>
- </tr>
- </table>
- </span>
- </p>
- </form>
- </body>
- </html>