hi everyone.

i'am a novice VBScript user. sorry for my illiteracy. i am developing a
web site using ASP and VBScript. i'm working on an Access database.

here,

in firstpage.asp i have a combobox. combobox lists names and surnames
of the users which are populated from the database [Server.CreateObject
("ADODB.Connection")]. I show each record's name and surname as one
item of the ComboBox(*). but i have to send the name and surname
information of selected item to nextpage.asp separately.

So, how can i accomplish this?

regards...

* I do this to show them separately:

<SELECT NAME="adsad">
<% Do While Not rec.eof %>
<OPTION VALUE="<%=rec(0)&" "&rec(1)%>"><%=rec(0)&" "&rec(1)%></OPTION>
<%
rec.MoveNext
loop
%>
</SELECT>

but rhere is only one "value" of "option" : [VALUE="<%=rec(0)&"
"&rec(1)%>]

Re: Two Fields in One Item of ComboBox and Posting Separately by mayayana

mayayana
Sat Mar 18 10:32:01 CST 2006

The Split function will split a string based on a given
delimiter. It returns an array. If you have a string
"John Smith" in your combo box you can use:

A1 = Split(ComboxString, " ")
That will return an array where A1(0) = "John"
and A1(1) = "Smith". You can then send each name
string separately.

You'll need to get a bit more involved to provide
for variations like middle initials or missing names.
You can check UBound(A1) to start:

If UBound(A1) = 1 then '-- you have one space in the name
'--string and therefore two items in
the array.

If UBound(A1) > 1 then '-- middle initial? needs to be cleaned up.

...etc....

> hi everyone.
>
> i'am a novice VBScript user. sorry for my illiteracy. i am developing a
> web site using ASP and VBScript. i'm working on an Access database.
>
> here,
>
> in firstpage.asp i have a combobox. combobox lists names and surnames
> of the users which are populated from the database [Server.CreateObject
> ("ADODB.Connection")]. I show each record's name and surname as one
> item of the ComboBox(*). but i have to send the name and surname
> information of selected item to nextpage.asp separately.
>
> So, how can i accomplish this?
>
> regards...
>
> * I do this to show them separately:
>
> <SELECT NAME="adsad">
> <% Do While Not rec.eof %>
> <OPTION VALUE="<%=rec(0)&" "&rec(1)%>"><%=rec(0)&" "&rec(1)%></OPTION>
> <%
> rec.MoveNext
> loop
> %>
> </SELECT>
>
> but rhere is only one "value" of "option" : [VALUE="<%=rec(0)&"
> "&rec(1)%>]
>



Re: Two Fields in One Item of ComboBox and Posting Separately by McKirahan

McKirahan
Sat Mar 18 11:22:51 CST 2006

"thecloudy°" <oguzhanoguzkan@gmail.com> wrote in message
news:1142599267.789127.13760@u72g2000cwu.googlegroups.com...
> hi everyone.
>
> i'am a novice VBScript user. sorry for my illiteracy. i am developing a
> web site using ASP and VBScript. i'm working on an Access database.
>
> here,
>
> in firstpage.asp i have a combobox. combobox lists names and surnames
> of the users which are populated from the database [Server.CreateObject
> ("ADODB.Connection")]. I show each record's name and surname as one
> item of the ComboBox(*). but i have to send the name and surname
> information of selected item to nextpage.asp separately.
>
> So, how can i accomplish this?
>
> regards...
>
> * I do this to show them separately:
>
> <SELECT NAME="adsad">
> <% Do While Not rec.eof %>
> <OPTION VALUE="<%=rec(0)&" "&rec(1)%>"><%=rec(0)&" "&rec(1)%></OPTION>
> <%
> rec.MoveNext
> loop
> %>
> </SELECT>
>
> but rhere is only one "value" of "option" : [VALUE="<%=rec(0)&"
> "&rec(1)%>]
>

Insert a special character (say "^") between
the first and last names in the VALUE=

<OPTION VALUE="<%=rec(0)&"^"&rec(1)%>">
<%=rec(0)&" "&rec(1)%></OPTION>

The on the next page, do this:

sName = Split(Request.Form("adsad"),"^")
sNameFirst = sName(0)
sNameLast = sName(1)

Let the server do the processing.



Re: Two Fields in One Item of ComboBox and Posting Separately by oguzhanoguzkan

oguzhanoguzkan
Sat Mar 25 05:53:10 CST 2006

Thank you McKirahan and mayayana.

i have understood the case you are suggesting about and thus, solved
the problem.

thanks for your consideration.

regards...