|
-
Apr 6th, 2001, 09:41 AM
#1
Thread Starter
Hyperactive Member
I'm quite new to ASP, so please bear with me.
I've got a simple list that displays informations from a database. What I want to be able to do is select an item from the list and for it to fill in the rest of the details on the screen?
Hows it done?
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Apr 6th, 2001, 10:22 AM
#2
Place the drop down list on a form, set the forms action to reload the current page. Pass the value from the dropdown list to an SQL query:
Code:
<form METHOD="POST" ACTION="parkes.asp" >
<SELECT NAME="Users" SIZE="1">
<OPTION VALUE="Bubba">Bubba
<OPTION VALUE="Parkes">Parkes
</SELECT>
<INPUT TYPE="SUBMIT" NAME="ACTION" VALUE="Select User">"
</form>
Elsewhere in your asp........
If Request("Action") = "Select User" Then
'run your sql query like
"Select * from tblUsers where username = '" & request("users") & "'"
End if
-
Apr 6th, 2001, 10:25 AM
#3
Thread Starter
Hyperactive Member
I'd like to be able to do this without reloading the page. I've seen it done, just cannot get to the code?
Thanks in advance for any help provided.
VB 6 Enterprise Edition SP4
ADO, SQL 7/2000, ASP and some JavaScript

>> Life goes on, but for how long? <<
If you can smile when things go wrong, you have someone in mind to blame
-
Apr 6th, 2001, 10:28 AM
#4
You can't post new data too a page without reloading/refreshing it.
-
May 18th, 2001, 08:28 AM
#5
Junior Member
Parkes,
I think Bubba is right. You'd have to reload the page. Except for one thing: if you're right about seeing it before, then it was probably XML and XSL. That's the beauty of XML - you pull all the data in at once (instead of multiple trips to the database every time a new selection is made), then you can sort the data right there on the screen. XML is actually not that hard. Check it out. It is probably what you need.
-
May 18th, 2001, 05:28 PM
#6
PowerPoster
If you had the stuff stored in say a client side array, then you could update it dynamically. But it is not possible to get info from the DB on the fly like that.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
May 18th, 2001, 09:43 PM
#7
Frenzied Member
It would have to be a small set of data too. Otherwise your page will be huge when it is downloaded. I have used the arrays technique to have cascading dropdowns.. one selection filters the next etc..
But if you have more than say 20 possibilities in the first dropdown, I wouldn't use this method.. An XML doc would be another answer..
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 19th, 2001, 03:20 AM
#8
Lively Member
conn.open
set rsup=server.CreateObject ("adodb.recordset")
sSQL="select * from prodcat "
rsup.Open sSQL,conn,adOpenStatic,adLockPessimistic ,adcmdtext
session("prodid")=Request.QueryString("id")
prodid=session("prodid")
if prodid="" then
prodid="select"
end if
<% Response.Write "<select name='menu1' onChange =MM_jumpMenu('self',this,0)>"
Response.Write "<option selected>" & prodid & "</option>"
while not rsup.EOF
Response.Write "<option value='receivingchallan.asp?id="& rsup("styleno")& "' >" & rsup("styleno") & "</option>"
rsup.MoveNext
wend
Response.Write "</select>"
rsup.Close
set rsup=nothing
%>
Elsewhere in your asp........
If Request.querysting("id")<>"select" then
'run your sql query like
"Select * from products where prodid = '" prodid & "'"
End if
<head>
<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
</script>
</head>
Adeel Ahmed
-
May 19th, 2001, 09:30 AM
#9
PowerPoster
I don't really see how that will work...
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
May 20th, 2001, 12:28 AM
#10
Lively Member
Adeel Ahmed
-
May 20th, 2001, 12:41 PM
#11
Frenzied Member
What the hell is that supposed to mean?
adeelahmed: Your code does nothing to address his problem
parkes: If you have a large number of options in the first select that would effect the other controls, use an XML file and load it into the document on the client side. If not, then build client side arrays to hold all of your data and just switch between the values in the onchange event of the select tag.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 21st, 2001, 03:15 AM
#12
Lively Member
Adeel Ahmed
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
|
Click Here to Expand Forum to Full Width
|