|
-
May 29th, 2001, 07:23 AM
#1
Thread Starter
Addicted Member
Combobox in ASP / HTML ?
Hi everyone !
1) I'm currently developping an ASP application using ADO. I want to know if it is possible to transfer the content of a particular field of all records in a table to a listbox ? If so, how ? I tried many things, but keep getting errors !
2) Is it possbile to transfer an array from the server to the client ?
If so, how ?
3) Is there anything like a combobox in HTML i could use (like in VB) ?
I'm rather new to ASP and HTML, but I guess you already figured it out ! :P
Thanks in advance !
-
May 29th, 2001, 07:56 AM
#2
Hyperactive Member
HTML
I know that there is a combobox available in HTML
When you make a Form (I think you know how)
You can add a combo by using:
<SELECT name="test">
<OPTION>OptionA</OPTION>
<OPTION>OptionB</OPTION>
<OPTION>OptionC</OPTION>
<OPTION>OptionD</OPTION>
</SELECT>
But how to import options from a table I don't know.
I hope I helped...
Grtz,
Bloged
-
May 29th, 2001, 07:57 AM
#3
Hyperactive Member
-
May 29th, 2001, 08:32 AM
#4
1) Goto http://www.learnasp.com. They have a couple articles on this.
2) Do you mean server as in from an ASP page to VbScript or Javascript on the client?
If so, No.
3) See above replies.
-
May 29th, 2001, 10:48 AM
#5
I'm pretty new to ASP too, but I know you can mix-and-match tags, so...
Code:
' blah blah, open database connection, get stuff out, open HTML and BODY tags in page, when you eventually get to the box, its something like this:
'while within HTML tag (ASP tag closed)
<SELECT name="test">
<%
for loop = 0 to wherever you want
%>
<option><%=loop%><option>
<%
next
%>
</select>
I know it looks a bit clumsy, I'm not able to test it, but I hope you get the gist of what I'm trying to say.
BTW the bold bit <%=loop%> means exactly the same as
<%
response.write loop
%>
-
May 29th, 2001, 01:50 PM
#6
Frenzied Member
You can sort of transfer an array between client and server:
You must use Response.Write to create the client side array code and populate it in the same manner.
You can not change it on the client and see those changes on the server unless you post the array back to the server in an HTML form tag or some other persistence method.
I use that all the time to create dynamic list boxes that change their content based on the selection in another list box.
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 30th, 2001, 11:39 AM
#7
Thread Starter
Addicted Member
Thanks for all the info guys !
Especially Behemoth, I modified your code to suit my needs, thanks dude !
I finally managed to get things up, Sort'of;
I Used a textbox refreshing on every <Select> which refreshes the textbox... well kinda dependent on each other ! Does the trick ! =)
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
|