Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Populate a dropdown list
#5
(2026-10-20, 18:40:48)GTGeek88 Wrote: That's not working. The HTML snippet is:
<snipped>

lnreturn = thisform.oAntviewDocument.SetElementValueByNameSync("MakeID", "Toyota")

as does this code (your code, but using "thisfomr.oAntviewDocument"):

thisform.oAntviewDocument.ElementValueByName("MakeID") = "Toyota"

I'm wondering if they are changing this dropdown in some fashion via JavaScript. When I inspect it with Chrome Dev Tools, it doesn't show what I'd expect.

Hi,

The html snippet you supplied has this bit:
Code:
<option value="66">Toyota</option>

As such when you try to set the value for the drop down you should set it as:

lnreturn = thisform.oAntviewDocument.SetElementValueByNameSync("MakeID", "66") 

or
thisform.oAntviewDocument.ElementValueByName("MakeID") = "66"

The example I showed could have been clearer about what part to set, that you should set the option value and not the text it shows.

--
Wil
Reply


Messages In This Thread
Populate a dropdown list - by GTGeek88 - 2026-10-19, 22:28:15
RE: Populate a dropdown list - by wila - 2026-10-20, 10:51:15
RE: Populate a dropdown list - by GTGeek88 - 2026-10-20, 18:40:48
RE: Populate a dropdown list - by wila - 2026-10-21, 08:29:31
RE: Populate a dropdown list - by GTGeek88 - 2026-10-20, 20:37:48
RE: Populate a dropdown list - by wila - 2026-10-21, 08:37:22
RE: Populate a dropdown list - by wila - 2026-10-21, 09:13:38
RE: Populate a dropdown list - by GTGeek88 - 2026-10-22, 17:25:05
RE: Populate a dropdown list - by wila - 2026-10-22, 21:37:18
RE: Populate a dropdown list - by GTGeek88 - 2026-10-23, 03:10:29
RE: Populate a dropdown list - by wila - 2026-10-23, 11:33:47

Forum Jump:


Users browsing this thread: 2 Guest(s)