473,670 Members | 2,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying the value in combobox

27 New Member
hi,

I want to change the combobox displaying value depending up on the action value. This is the example code,
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <script Language="JavaScript">
  5. function check(action)
  6. {
  7. if(action=="hourly")
  8. {
  9. //code insert here
  10. //this action equals hourly i have to display the Hourly in the combobox.
  11. }
  12. }
  13. </script>
  14. <body onLoad="check('hourly')">
  15. <SELECT name=NavBox id="NavCo">
  16. <OPTION>Default
  17. <OPTION>Hourly
  18. <OPTION>Daily
  19. <OPTION>Monthly</OPTION>
  20. </SELECT>
  21. </body>
  22. </html>
  23.  

How can i do this.

Thanks in advance.
Dec 14 '07 #1
1 1164
Dasty
101 Recognized Expert New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. </head>
  4. <script Language="JavaScript">
  5. function check(action)
  6. {
  7.   document.getElementById('NavCo').value = action;
  8. }
  9. </script>
  10. <body onLoad="check('hourly')">
  11.   <SELECT name=NavBox id="NavCo">
  12.     <OPTION value="default">Default</OPTION>
  13.     <OPTION value="hourly">Hourly</OPTION>
  14.     <OPTION value="daily">Daily</OPTION>
  15.     <OPTION value="monthly">Monthly</OPTION>
  16.   </SELECT>
  17. </body>
  18. </html>
Maybe setting value for each option is not looking good, but it works in all browsers. :)
Dec 14 '07 #2

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

Similar topics

1
1865
by: Laphan | last post by:
Hi All Sorry for the confusing subject, but I'm hoping that you will be able to help. In very basic terms I want to emulate a <SELECT> HTML box in VB. All I want to do is display a title name in the drop-down list, but the actual value I use would be something else.
2
2503
by: Susan Bricker | last post by:
Greetings! Still the same application (as previous posts). I worked on the app while at work (don't tell my boss ... cause this is just for fun and not work related) and the form was working, but now when I try to repeat the code at home (for real) it won't work. I suspect that I haven't replicated the logic and forms at home from what I remember that I did while at work. My subform is based on a table called "tblTrialClass" and it...
0
1206
by: Johann Blake | last post by:
I have a dataset that I bind to two different datagrids. The dataset contains 2 tables. One is the main table used to store what I call session data which includes a Country field where the ID of a country is stored. The second table contains a list of countries. When adding records to the dataset, I use a form that contains a datagrid and this grid has a combobox that allows the user to select the country. The combobox retrieves its...
15
1512
by: Bo Diddly | last post by:
Hi everyone, I am relatively new to VB.Net, and database programming. I have a database with four tables, set up as follows: tblBook BookID... key Book... All the book titles of the Bible tblChapter ChapterID... key
4
1370
by: John Suru | last post by:
I am loading up a combobox with data from an access database. The field I am loading is a date/time datatype. The data in the field is a short date(ex. 01/22/2004). When I load the combobox with the data it appears correct. When I click on the dropdown arrow of the combobox, all of the entries have 12:00:00 AM added to the end of the date entries. Instead of displaying 01/22/2004 the combobox displays 01/22/2004 12:00:00 AM. What do I need to...
2
1182
by: max | last post by:
Hello, I have a VS2005 framework and ado.net. I have an access db with two tables: 1) Patients; 2) Doctors. The 'Patients table is already filled by a long list of records (coming from an old access db) in 3 columns: ID, Name, Doctorname (for that patient); The Doctors table is filled by only a column: Doctorname, which is a current list of doctors working here at now. I want put on a form just the 'Patient' table, with a combobox for...
3
1699
by: sharperrr | last post by:
Access2000 Hi I have a combobox which displays a list of values dependent on another field. On the fields onchange event the rowsource of the combobox changes according to the value in the field. The problem I have is the combo box displays the last value selected, the list it contains is updated but until the combobox is selected it displays the last value. This is very confusing to the users. Suggestions please. Even a nice easy...
33
5531
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r not dislaying if enter the data the it is inserting properly) javascript code follows pls help me to solve this problem function fnKeyDownHandler(getdropdown, e) { fnSanityCheck(getdropdown);
5
1944
by: sejal17 | last post by:
hello everyone, I have a problem with displaying records between two dates.Below is my designing page: start date: combobox of month(smonth) & combobox of year(syear) end date : combobox of month(emonth) & combobox of year(eyear) I want the records between this month and year.i have written the below query for that: suppose, smonth=01,emonth=08,syear=2000,eyear=2005
0
8466
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
8384
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,...
0
8896
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8810
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8590
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
7410
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...
0
5683
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
4387
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2798
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

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.