473,595 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update form field from vbscript sub

I have a asp form that has a dynamic drop-down box that a user selects
a value from. Once the user makes a selection I use the onChange event
to capture the selection and pass this value to a vbscript sub. The sub
then makes a adsi query using this value to retrieve additional
information. This all works. I used a msgbox to display the retrieved
value and it is correct. My problem is how do I update a field on the
form with this retrieved value?

Dec 15 '06 #1
1 7079
Michael McGrew wrote:
I have a asp form that has a dynamic drop-down box that a user selects
a value from. Once the user makes a selection I use the onChange event
to capture the selection and pass this value to a vbscript sub. The
sub then makes a adsi query using this value to retrieve additional
information. This all works. I used a msgbox to display the retrieved
value and it is correct. My problem is how do I update a field on the
form with this retrieved value?
This isn't really an asp issue, is it. You would be asking the same
question if your page had a .htm extension. Client-side scripting
questions should be posted to one of the .scripting groups: in this case
microsoft.publi c.scripting.vbs cript. Of course, you will have to deal
with the replies ridiculing your use of vbscript in client-side code
(because it restricts your users to IE), but once you get past that, you
should get some help.

Having said that, you need to use the document.GetEle mentById method
toget a reference to the "field" and then set its value property to the
data retrieved from adsi.
sub GetADSIValue()
dim valuefromadsi
'get the value from adsi and assign it to the variable; then:
dim obj
set obj=document.Ge tElementById("i d_of_field")
obj.value= valuefromadsi
end sub

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4069
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
1
1518
by: wolfing1 | last post by:
So the html looks like this: <%@ Language="VBScript" %> <%Option Explicit %> <html> <head>...</head> <body> <form name="myform"> <table> <% for x=1 to 10 response.write "<tr><td><input type=checkbox name=ch"+cstr(x)+" onclick='vbscript:call f("+cstr(x)+") </td></tr>" %>
5
2348
by: A.Dagostino | last post by:
hi i need to update an SQL Table when user select or unselect a checkbox control. How Can i do? Thanks Alex
1
2123
by: Jack | last post by:
Hi, I got a test asp page which connects to Northwind.mdb database. This page pulls all the rows from the Customers table. One column i.e. GoodStatus has been added to the customers table. The following is the code to display all records of the customers table with some customization. CODE: <%@ Language=VBScript %> <!-- #include file="adovbs.inc" --> <HTML> <BODY>
1
11461
by: David Shorthouse | last post by:
Hey folks, I am attempting to pass null as the input value from a series of textboxes if the user does not input a value prior to submit. To try and do this, I am using a vbscript function on this asp as follows: CommentsAdd = IIf(Request.Form("Comments")="",NULL,Request.Form("Comments")) I was hoping this would convert those emptystring textboxes to null.
2
19584
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the field in table2. What I have is a form that is linked to Table2. If the users want to change a field in the main database (table1), they fill the change in to the form (which is linked to table2) If there is no change to the field, they simply...
3
2918
by: Simon Gare | last post by:
Hi all, have a 'money' field in the SQL 2000 table that users enter 200 (for example which represents £2.00) without the decimal point, what I need is to have a command or something that adds the decimal point before the last 2 digits, so user enters 200 and the value stored in the table is 2.00 bearing in mind that this value could be anything from 1.00 to 50.00. The user enters the data from an asp page on a touch screen device.
3
1780
by: Dilruba | last post by:
asp, vbscript, Ms Access I am using vbscript to insert & update ms accees. Insert operation is working , but update operation is not working. I have used the following codes: connectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:\progam files\mail.mdb"
1
4712
by: xernoth | last post by:
Hi there, Just a quick question. I'm more familiar with C# and ASP.NET but need to use ASP/VBScript for a quick project. I have a form that uploads content to a server not managed by us. When the form is filled in and posted, the response from the server is an XML response. However when that happens, I'm not longer at my asp page, I'm redirected the XML response URL that's managed by the third party server.
0
7955
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
8261
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
8251
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...
0
6674
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
5839
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
3873
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...
1
2391
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
1
1490
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1223
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.