473,785 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

programmaticall y select an option in dropdown

13 New Member
Hi friends,

I have an (VBA) application which programatically fills the values in a web page.
In the web page there is a dropdown menu whose options are selected during run-time by using a function.Is there anyway by which I can select the option in the dropdown menu programatically ?
If the dropdown menu in the web page had its options explicitily mentioned (like <option value="1">1</option>...) I could have used document.form.o bjectname.selec tedindex=n in the VBA code.
But here all I have is a function to generate the values in the dropdown menu.
like...
<select name="name" id= "">
print_month_ele ment_drop_down_ menu(1, 12, 2, ' ');
</select>
Is there a wayout to select the desired value programmaticall y from my VBA application?

(I am temporarily using the sendkeys method,but it isnt that gr8 a solution...:-))

Regards,
Balu435
Mar 2 '07 #1
3 2200
willakawill
1,646 Top Contributor
Moved your question to asp so that you might get a better chance at an answer
Mar 4 '07 #2
balu435
13 New Member
Moved your question to asp so that you might get a better chance at an answer
ok...I hope I would get the logic...
.thanks..:-)
Mar 5 '07 #3
balu435
13 New Member
ok...I hope I would get the logic...
.thanks..:-)
Hi..
Its working now..
I gave the code as document.form.o bject.selectedi ndex.=n
where n is the index of the required value..
I dont understand if it can get so simple..anyway its working..:-)
Mar 5 '07 #4

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

Similar topics

2
8994
by: Oskar Wild | last post by:
Hello, how do I code it to display a select (pulldown) box only if the user has selected a certain option in another pulldown box? <select name=country> <OPTION value="France" SELECTED>France <OPTION value="Spain">Spain <OPTION value="Portugal">Portugal </select>
6
3468
by: passion_to_be_free | last post by:
This is probably simple, but I can't seem to find it anywhere. I have have some values stored in javascript variables. I have a <select> dropdown list whose options correspond to these values. I want to be able to select an item on the dropdown list based on the value of the javascript variable. Let's say this is my list and my variable: <select id='popup'>
7
2057
by: pk | last post by:
Here is my code, and it's not working. Please help me get through this. I've read every single tutorial and you may even see remnants of some of their variables in my code. I don't know if I'm close, but I feel that I'm getting there. Thanks in advance for any help. I much appreciate it. -pk <SCRIPT>
2
8095
by: Monty | last post by:
I use a SELECT dropdown as the nav interface for jumping to a chosen page number. When I setup up the SELECT element on the page, I want to show the user the current page number they are on, so, I put "selected" next to the page number, as shown below: ------------------------------- <form name="pick" method="post" action="showit.php"> <select name="pggo" onChange="this.options.selected;document.pick.submit();">
7
1911
by: sean | last post by:
SELECT drop-list width incorrect for long text when SELECT is fixed width Setting the width style of a SELECT statement causes the contents of the drop-list to be cropped. This is problematic when attempting to limit the width of the select box for layout purposes (say, a fixed-dimensions application UI) whilst still presenting the user with all of the required information to make a choice. Any clue to solve the above issue is highly...
5
3594
by: balu435 | last post by:
Hi friends, I have an (VBA) application which programatically fills the options in a web page. I have an dropdown menu whose options are selected during run-time by using a function.Is there anyway by which I can select the option in the dropdown menu programatically? If the dropdown menu had its options explicitily mentioned (like <option value="1">1</option>...) I could have used document.form.objectname.selectedindex=n But here all I...
4
5809
by: =?Utf-8?B?c2lMdmVy?= | last post by:
Hhi, I'm working on an asp .net project that have small side panel which 'disallow' long SELECT/dropdown list.. So i could not force them to a certain that shows my longest option, which now most of my option was being 'cut-off' half way, not able to show to full text.. Is there any way I could do some thing like in e Mozilla FireFox (as currently using IE), which 'opens' e dropdown list when being click and shows e full text that...
7
1863
by: fran7 | last post by:
Hi, I am having trouble with this dropdown. With it I am passing an id to the next page but displaying a description in the dropdown. Trouble is it displays a description for every postid so I am getting multiple duplicate descriptions in the dropdown. like drawing drawing drawing ceramics ceramics. I can see the problem as I am passing a unique postid its populating the dropdown with all the descriptions associated with my postids. I...
1
24387
by: RichardR | last post by:
I have a webpage which has a table that contains a column with several drop down boxes (<SELECT>). The contents of the drop down boxes are dynamically populated so I have no idea what the actually width will be necessary. How do I tell the dropdown (<SELECT>) and/or column (<TD>) to automatically size itself to the greater of widest item in the dropdown, and then get the smaller dropdowns to fill the width of the column? If I specify in...
0
9645
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
10327
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
10151
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
10092
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
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
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
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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.