Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Update form field from vbscript sub

Reply
Thread Tools

Update form field from vbscript sub

 
 
Michael McGrew
Guest
Posts: n/a
 
      12-15-2006
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?

 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      12-15-2006
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.public.scripting.vbscript. 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.GetElementById 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.GetElementById("id_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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
Pass hidden form field value to another form field to insert in db GavMc ASP General 4 09-22-2005 06:33 PM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven Javascript 3 05-13-2004 12:15 AM
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome? NotGiven ASP General 3 05-13-2004 12:15 AM



Advertisments