473,804 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retrieve selected value

5 New Member
how do I get a cell value for selected qty? Please help!!!
below is the code.

Thanks,

Expand|Select|Wrap|Line Numbers
  1. <?xml version = "1.0" encoding = "utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4.  
  5. <html xmlns = "http://www.w3.org/1999/xhtml">
  6.  
  7.  
  8.    <head>
  9.     <title>Incredible Roadside Assistance&reg; - Products</title>    
  10.  
  11.     <object id = "Product"
  12.         classid = "CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83">
  13.         <!--supply file location and name-->
  14.         <param name = "DataURL" value = "Products.txt" />
  15.         <!--specify whether first row is a header-->
  16.         <param name = "UseHeader" value = "TRUE" />
  17.         <!--denote the data field start and end -->
  18.         <param name = "TextQualifier" value = "*" />
  19.         <!--denote the field delimiter-->
  20.         <param name = "FieldDelim" value = "|" />
  21.     </object>
  22.  
  23.     <script type = "text/javascript">
  24.  
  25.     function submitForm( )
  26.     {    
  27.        alert("submit");
  28.  
  29.        var fileSysObj = new ActiveXObject("Scripting.FileSystemObject") ;
  30.        var textFile = fileSysObj.CreateTextFile("Order.txt", true) ;
  31.        var qty="";
  32.        alert( getText(document.getElementById("qty")) );       
  33.        textFile.WriteLine("total") ;
  34.        textFile.Close( ) ;       
  35.        window.alert("A file has been created.") ;
  36.  
  37.  
  38.     }
  39.  
  40.     function getText(el)
  41.     {
  42.         if (el.textContent) return el.textContent;
  43.         if (el.innerText) return el.innerText;
  44.         return el.innerHTML.replace(/<[^>]*>/g,'');
  45.     }
  46.  
  47.  
  48.     function resetForm( )
  49.     {
  50.     //set event's return value to false to override its default behavior
  51.     window.event.returnValue = false ;
  52.     //display a msgbox with OK and Cancel buttons on it
  53.     if (confirm("Are you sure you want to clear the form?"))
  54.        {
  55.         //let the default behavior occur
  56.         window.event.returnValue = true ;
  57.        }
  58.     else
  59.        {
  60.         //do nothing
  61.        }
  62.     }
  63.  
  64.     function createFile( )
  65.     {
  66.  
  67.     }
  68.  
  69.     //]]>
  70.     </script>
  71.  
  72.    </head>
  73.  
  74.    <body style = "background-color: bisque">
  75.    <form id="form1" onsubmit= "submitForm( )" onreset="resetForm( )" action=" ">
  76.     <h1 style = "text-align:center">Incredible Roadside Assistance&reg; - Product Information</h1>
  77.     <div style = "text-align: center">
  78.        <select onchange = "Product.Sort = this.value; Product.Reset( ); ">
  79.         <!--sort by Product ID data field in ascending order-->
  80.         <option value = "ProdID">Product ID - Ascending</option>
  81.         <!--sort by Product ID data field in descending order-->
  82.         <option value = "-ProdID">Product ID - Descending</option>
  83.         <!--sort by Product Name data field in ascending order-->
  84.         <option value = "ProdName" selected>Product Name - Ascending</option>
  85.         <!--sort by Product Name data field in descending order-->
  86.         <option value = "-ProdName">Product Name - Descending</option>
  87.         <!--sort by Product Desc data field in ascending order-->
  88.         <option value = "ProdDesc">Product Description - Ascending</option>
  89.         <!--sort by Product Desc data field in descending order-->
  90.         <option value = "-ProdDesc">Product Description - Descending</option>
  91.        </select>
  92.     </div>
  93.     <p>
  94.     <span style = "background-color: bisque; position: absolute;
  95.        margin-left: 15%; width: 67%; border-style: ridge; text-align: center;
  96.        padding: 1em">
  97.        <table id="myTable" datasrc = "#Product" >
  98.         <thead>
  99.            <tr>
  100.             <th>Product ID</th>
  101.             <th>Product Name</th>
  102.             <th>Description</th>
  103.             <th>&nbsp;</th>
  104.             <th>Qty</th>
  105.             <th></th>
  106.            </tr>
  107.         </thead>
  108.         <tbody>
  109.            <tr>
  110.               <td>
  111.                 <span datafld = "ProdID">Product ID goes here.</span>
  112.               </td>
  113.               <td>
  114.                 <span datafld = "ProdName">Name goes here.</span>
  115.               </td>
  116.               <td>              
  117.                 <span datafld = "ProdDesc">Description goes here.</span>
  118.               </td>
  119.               <td>
  120.                 <span>
  121.                    <img datafld = "Image" alt="Image goes here."></img>
  122.                 </span>
  123.               </td>
  124.               <td>
  125.             <span>
  126.             <select ID="qty" Name="qty" onchange = "Product.Sort = this.value; ">
  127.                     <option value = "0">0</option>
  128.                     <option value = "1">1</option>
  129.                     <option value = "2">2</option>
  130.                     <option value = "3">3</option>
  131.                     <option value = "4">4</option>
  132.                     <option value = "5">5</option>
  133.                     <option value = "6">6</option>
  134.                     <option value = "7">7</option>
  135.                     <option value = "8">8</option>
  136.                     <option value = "9">9</option>
  137.                     <option value = "10">10</option>
  138.                        </select>
  139.                 </span>
  140.               </td>
  141.            </tr>
  142.         </tbody>
  143.        </table>
  144.        <table>
  145.         <tr>
  146.             <td>
  147.                 <input type="submit" id="btnSubmit" value="Submit" />
  148.                 &nbsp;&nbsp;
  149.                 <input type="reset" id="btnCancel" value="Cancel" />
  150.             </td>
  151.         </tr>
  152.        </table>
  153.      </span>
  154.     </p>
  155.     </form>
  156.    </body>
  157. </html>
Apr 26 '10 #1
1 2028
Dormilich
8,658 Recognized Expert Moderator Expert
form controls always have the .value attribute/property, holding their, er, value.

PS. that code only works in IE (just to have it mentioned)
Apr 27 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2377
by: Jefferis NoSpamme | last post by:
Hi folks, Trying to fill in a gap in my understanding of php, and so this is rather newbish: I have created a form where a user selects 2 items from a list of 8 values. That form field is called "choices" and returns a value to the php file as $choices. This form posed no problem when I only allowed a single item to be selected, but the client now needs to have 2 items selected at a time.
1
2771
by: Cipher | last post by:
I've got a DropDownList control on my ASP.Net page and I cannot retrieve it's value (via its SelectedValue property) if the control is hidden or disabled. Once I set the control to visible and enabled then the currently selected value is available in code. Any ideas how I can hide or disable a DropDownList but still retrieve its value as I don't want the users to be able to directly change its value. Thanks in advance.
2
5436
by: Rob | last post by:
Hi all, I've got multiple sets of radio button that are dynamically created in code and populated by a database query. The query returns about 20 recordsets with 3 radio buttons per recordset and I want to be able to retrieve the selected value from each of the sets of radio buttons.The names of each group of radio buttons is set by the database and I don't know how to retrieve the values because I don't know the names of these radio...
0
1685
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a specified date. - DeleteProfile. Enables you to delete a profile associated with a specified username. - DeleteProfiles. Enables you to delete a set of profiles. - FindInactiveProfilesByUserName. Returns a collection of ProfileInfo
2
2336
by: Micela | last post by:
Hi, Please help me out in this task. I have a filed in the database of datetime. and 3 dropdown lists in the page. Im using Asp.net with VB coding. The three dropdown lists are 1.for date 2.for month 3.for year the value selected is to be placed in the db and after that to be retrieved to the page with selected values.
1
4201
by: dudis3 | last post by:
Hello, I have this problem, I have populated a multiselect ListBox, but now I need to retrieve selected values, and use them as a parameters on the url e.g http://www.aaa.com/Dynamicpage.aspx?states=(value or values) - which will be selected from this ListBox, how do I separate multiple values when they get selected? Thank you
1
2403
by: prashu | last post by:
how to retrieve a value selected in a drop down list box using jsp
21
2907
by: giandeo | last post by:
Hello Experts. Is it possible to retrieve the value from a populated pull down menu from a database and then use that value to access the same database to get the related fields. Example: Database name: sp Table: importer Field names: imp_code, imp_name, imp_address, imp_tel
1
3691
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
10
6249
by: puT3 | last post by:
I want to get the value from Product_Price field which it will display it record on a text box based on a product that is selected from a list box. Product Table Product_ID Product_Name Product_Price Product_Quantity Product_Picture
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10359
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.