Sub pagepart_getISInstructor
set rsII = db.getRS("SELECT * FROM Users WHERE Enable='Yes' AND
Users.ID=" & db.SQLSafe(Request.Cookies("ID")) & " Order By Lname",
empty)
If NOT rsII.EOF Then
str.Write("<Select name='frmInstructor'>")
While Not rsII.EOF
str.Write("<Option value='" & Encrypt1(rsII("UserID")) & "%" &
rsII("LName") & ">" & rsII("LName") & "," & rsII("FName") & "</
Option>")
rsII.MoveNext()
Wend
str.Write("</Select>")
Else
str.Write("No Instructors found.")
End If
str.Write("<A HREF='#'
onclick='ajaxed.callback('getOSInstructor','Instructor')'>switch to
outside instructor</A>")
End Sub
I can write anything after 'wend' statement but nothing shows up????
I recommend you see this guide on ajaxed.org
http://www.ajaxed.org/article/Creating-dependent-dropdowns/20/, or you
could also see the option in the dropdown api http://www.ajaxed.org/api/#class_9
well, anything here we are!
artjc :-)
Is there a list of articles avaialble?
The one you listed was great.
One other question. How could I call my own encryption function on the
"datavaluefield" of the dropdown?
Mike...
On Mar 15, 1:59 pm, artjc <aleph...@gmail.com> wrote:
> Hi Mike,
>
> I recommend you see this guide on ajaxed.orghttp://www.ajaxed.org/article/Creating-dependent-dropdowns/20/, or you
> could also see the option in the dropdown apihttp://www.ajaxed.org/api/#class_9
> > I can write anything after 'wend' statement but nothing shows up????- Hide quoted text -
>
> - Show quoted text -
sub drawProductDD()
with new Dropdown
.datasource = "SELECT * FROM Products ORDER BY product"
.dataTextField = "product"
.dataValueField = "id"
.name = "prod"
.commonFieldText = "-- product --"
.commonFieldValue = ""
.onItemCreated = "onEncript" ' this is the key for you question
.draw()
end with
end sub
sub onEncript(it)
it.value = encript(it.value) ' here you encript script
end sub
artjc :-) Juan Carlos
sub drawProductDD()
with new Dropdown
.datasource = "SELECT * FROM Products ORDER BY product"
.dataTextField = "product"
.dataValueField = "id"
.name = "prod"
.commonFieldText = "-- product --"
.commonFieldValue = ""
.onItemCreated = "onEncript" ' this is the key for you question
.draw()
end with
end sub
sub onEncript(it)
it.value = encript(it.value) ' here you encript script
end sub
artjc :-) Juan Carlos
On 15 mar, 22:15, ItHurtsWhenIThink <madiaz91...@gmail.com> wrote:
Got everything going, except one thing. Cannot seem to be able to pass
a value from my first page part (getShift) to my second page part
(getWho)
Need to send shift to next page part to filter dropdown.
I set the name: .name = "frmShift"
Then called it on the next page: page.RF("frmShift")
sub pagepart_getShift
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE
DeptID='{0}'",Request.Cookies("DeptID"))
.dataTextField = "ShiftName"
.dataValueField = "ShiftName"
.commonFieldText = "-- Shift --"
.name = "frmShift"
.attributes = "onchange=""ajaxed.callback('getWho', 'peeps')"""
.onItemCreated = "onEncript"
.draw()
end with
end sub
Sub pagepart_getWho
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT UserID,LName + SPACE(1)
+ SPACE(1) + FName + SPACE(1) + SPACE(1) + EmployeeID FROM Users WHERE
Enable='Yes' AND DeptID=" & db.SQLSafe(Request.Cookies("DeptID")) & "
AND Shift= '{0}' Order By Lname", page.RF("frmShift"))
.dataTextField = 1 '"LName"
.dataValueField = 0 '"UserID"
.commonFieldText = "-- User --"
.name = "frmStudent"
.draw()
end with
str.write("<br>val=" & page.RF("frmShift"))
End Sub
sub onEncript(it)
it.value = Encrypt1(it.value)
end sub
> > > - Show quoted text -- Hide quoted text -
.dataTextField = 1 '"LName"
.dataValueField = 0 '"UserID"
Maybe if you leave the table values?
Later I help you, I have a little longer.
Juan Carlos :-)
The issue is that the value from the selected dropdown list is not
been passed onto the next pagepart. The value from the first dropdown
is used in the SQL statement to filter the second droprdown list. The
first page part that gets fired is the "getShift" pagepart. Then it
takes the value from the dropdown over to the next pagepart sub
"getWho"
Look, this example I work very well, looks like what you do:
sub drawProductDD()
with new Dropdown
.datasource = "SELECT * FROM Productos ORDER BY producto"
.dataTextField = "producto"
.dataValueField = "idProducto"
.name = "prod"
.commonFieldText = "-- producto --"
.commonFieldValue = ""
.attributes = "onchange=""ajaxed.callback('compositeDD',
'composite')"""
.selectedValue = initialValue("prod")
.draw()
end with
end sub
sub pagePart_compositeDD()
idpart = page.RFP("prod", 0)
with new Dropdown
set .datasource = db.getUnlockedRS( _
"SELECT * FROM PreguntaClasCompuesto WHERE idProducto = '{0}'
ORDER BY compuesto", _
idpart _
)
.dataTextField = "compuesto"
.dataValueField = "idCompuesto"
.name = "comp"
.commonFieldText = "-- compuesto --"
.commonFieldValue = ""
.disabled = idpart = 0
.selectedValue = initialValue("comp")
.draw()
end with
end sub
I think the problem is in the query, Check it well to see:
"SELECT UserID,LName+SPACE(1)+SPACE(1)+FName
+SPACE(1)+SPACE(1)+EmployeeID "& _
"FROM Users WHERE Enable='Yes' AND
DeptID="&db.SQLSafe(Request.Cookies("DeptID"))& _
" AND Shift='{0}' ORDER BY Lname"
artjc :-)
The value not passing was due to my form name, it was not named "frm".
So it passes the data to the next pagePart just fine, EXCEPT for the
value is cancanated with "NONE,"
if the value selected was "B" then the value I get is "NONE,B". Where
is the "NONE," coming from????? Value should be a single character.
Here is the code:
sub pagepart_getShift
with new Dropdown
Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE
DeptID='" & Request.Cookies("DeptID") & "'",empty)
.dataTextField = "ShiftName"
.dataValueField = "ShiftName"
.commonFieldText = "-- Shift --"
.name = "frmShift"
.attributes = "onchange=""ajaxed.callback('getWho', 'peeps')"""
.draw()
end with
end sub
Only issue now is that my last dropdown
I wonder!. It is necessary that your sub is a pagepart because I see
no dynamic data, unless the cookie is dynamic, you could not leave him
alone as getShift.
Change as you had it:
myDeptID = db.SQLSafe(Request.Cookies("DeptID"))
Set .datasource = db.getUnlockedRS("SELECT ShiftName FROM Shifts WHERE
DeptID='{0}'",myDeptID)
The other also depends on where you use this code, try using it before
the <html> tag, this is important to use cookies.
You've made some changes to the class dropdown?
The truth, I do not know how to help more.
artjc :-)