473,795 Members | 2,914 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 2202
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
8996
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
3469
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
2059
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
3596
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
24391
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
9673
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
9522
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
10448
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
10217
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
10167
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
5566
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2922
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.