-
Dynamically Load a Drop Down List Box
Hi -
One Other question. How is it possible to dynamically load a drop down selection
list box with data while the page is loaded on the client's machine?
Many thanks
Larry
-
Re: Dynamically Load a Drop Down List Box
Try this. Don't worry about the fact that I'm processing a recordset; this
IS client-side code (I'm using RDS to get a recordset to the client dynamically).
The source of the data that you use to load your combo/list box is whatever
you need.
Sub LoadStates()
Dim rsStates
Dim fldStAbbr
Dim fldStName
Dim objOptionElement
Dim nX
Set rsStates = gobjNCSCAT.GetRecordSet "ndstate"
Set fldStAbbr = rsStates.fields.item("stabbr")
Set fldStName = rsStates.fields.item("stname")
nX = 0
While Not rsStates.EOF
Set objOptionElement = window.document.createElement("OPTION")
objOptionElement.value = fldStAbbr.value
objOptionElement.text = fldStAbbr.value & " - " & fldStName.value
window.frmContactMaint.cboStCdContact.add objOptionElement
rsStates.MoveNext
nX = nX + 1
Set objOptionElement = Nothing
Wend
Set rsStates = Nothing
Set fldStAbbr = Nothing
Set fldStName = Nothing
End Sub
"Larry Hunter" <Hunterlmc@gateway.net> wrote:
>
>
>
>Hi -
>
>One Other question. How is it possible to dynamically load a drop down
selection
>list box with data while the page is loaded on the client's machine?
>
>Many thanks
>
>Larry
>
>
-
Re: Dynamically Load a Drop Down List Box
Another developer suggested that I use the IFRAME tag to reference another
page. This approach has the benefit of allowing me to query the database
for the values that I require. However, this approach also leaves the question
of how I pass selected values back from the frame.
Larry
"Glenn" <gaclark@broughton-sys.com> wrote:
>
>Try this. Don't worry about the fact that I'm processing a recordset; this
>IS client-side code (I'm using RDS to get a recordset to the client dynamically).
> The source of the data that you use to load your combo/list box is whatever
>you need.
>
>Sub LoadStates()
>
> Dim rsStates
> Dim fldStAbbr
> Dim fldStName
> Dim objOptionElement
> Dim nX
>
> Set rsStates = gobjNCSCAT.GetRecordSet "ndstate"
> Set fldStAbbr = rsStates.fields.item("stabbr")
> Set fldStName = rsStates.fields.item("stname")
>
> nX = 0
>
> While Not rsStates.EOF
> Set objOptionElement = window.document.createElement("OPTION")
> objOptionElement.value = fldStAbbr.value
> objOptionElement.text = fldStAbbr.value & " - " & fldStName.value
> window.frmContactMaint.cboStCdContact.add objOptionElement
>
> rsStates.MoveNext
> nX = nX + 1
> Set objOptionElement = Nothing
> Wend
>
> Set rsStates = Nothing
> Set fldStAbbr = Nothing
> Set fldStName = Nothing
>
>End Sub
>
>
>
>"Larry Hunter" <Hunterlmc@gateway.net> wrote:
>>
>>
>>
>>Hi -
>>
>>One Other question. How is it possible to dynamically load a drop down
>selection
>>list box with data while the page is loaded on the client's machine?
>>
>>Many thanks
>>
>>Larry
>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|