The dropdown list is taken from a databse. I need to add an item to
the dropdown list (first item). You know when you want to aloow a user
to modify a record with data from a db table, but you need to have the
first item in the dropdown list the value of the current record they
are modifing. That is what I am trying to do.
Here is a chunck of code I am using. Just need to add an item to
dropdown list (first item on list).
Sub pagepart_getOSInstructor
with new Dropdown
Set .datasource = db.getUnlockedRS("Select FName + ' ' + LName AS
Instructor, UserID FROM Users AS U, tr_Instructors AS T Where
T.InstructorID=U.UserID AND T.DeptID='{0}' AND U.Enable='Yes'",
Request.Cookies("DeptID"))
.dataTextField = "Instructor"
.dataValueField = "UserID"
.commonFieldText = "-- Instructor --"
.name = "frmInstructor"
'######## liie to add list item #######
' HOW DO I ADD NEW ITEM i.e.,
.getNewItem("12345","Wayne Jones") ' THIS DOES NOT WORK
'##############################
.onItemCreated = "onEncript"
.attributes = "onchange=""ajaxed.callback('getTeacher',
'Instructor')"""
.draw()
end with
End Sub
So, How do I get a new dropdown item to show up.
Thanks,
Mike....
On Oct 2, 4:09Â am, Dai bok <
rankin...@gmail.com> wrote:
> Hi Mike,
>
> Just moving your question into a seprate thread. From the look of
> things, the getnewitem just creates and returns an instance of a
> dropdown item. It does not add this item to the datasource of dropdown
> items. I think that is what are expecting it to do?
>
> (I am on my mac now, and don't have access to windows to test things
> out, so I will try help if I can)
>
> I am guessing that you do somthing like this instead:
> ...
> set ddItem = myDD.getNewItem("12345","Wayne Jones")
> ddItem.draw()
> ...
>
> Let me know if that helps?
> (note to self - must get bootcamp working!)
>
> On Oct 1, 8:30 pm, ItHurtsWhenIThink <
madiaz91...@gmail.com> wrote:> Speaking of dropdown, can you please take a look at the following
> > example and tell me why this code will not add a new dropdown item?
>
> > >>>>> Â DD <<<<<<<<<<<<<<
>
> > sub drawDD()
> > Â with new Dropdown
> > Â Â 'you can also use SQL, Dictionary, ...
> > Â Â .datasource = array("Jack Johnson", "John Meyer")
> > Â Â .name = "myDD"
>
> > '##########################################################################Â####################################
> > Â Â Â '###### Â I keep getting errors right here "cannot use parethesis
> > in sub" Â I remove them but dropdown will not add new item #########
> > Â Â .getNewItem("12345","Wayne Jones")
>
> > '##########################################################################Â####################################