Drop down box query

C

Chris

Q::
I have a database and a form .I want the dropdown box to have multiple
fields attached to each option. That I have done with the script at the
bottom however I was wondering If anybody could help me with the following.

On submitting the selection in the form I would like the fields to be
submitted to their own database field(individually)(Split from one another)


"""""<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>"""""
would i need to change this statement
aswell???"""fp_sMenuValue="URL".............."""

These are the two fields i would like to have split into their own database
fileds on submit """URL""" and """Reference"""

If this is impossible or to technical could one use a type of script to call
just a section of the field.


Thanks to anybody taking time to answer this for me.

Cheers

Chris



.......""
<nobr><!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,Gotitcategory,Reference,Price,URL,Remote_computer_name,Use
r_name,Browser_type,Timestamp"
s-columntypes="3,202,202,202,202,202,202,202,135"
s-dataconnection="4Gotiturl" b-tableformat="FALSE" b-menuformat="TRUE"
s-menuchoice="Reference" s-menuvalue="URL" b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE"
s-recordsource="Results" s-displaycolumns="Reference,URL" s-criteria
s-order="[Gotitcategory] +" s-sql="SELECT * FROM Results ORDER BY
Gotitcategory ASC" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields s-norecordsfound="" i-maxrecords="256" i-groupsize="0"
botid="1" u-dblib="../../_fpclass/fpdblib.inc"
u-dbrgn1="../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" preview=" &lt;span style=&quot;color:
rgb(0,0,0); background-color: rgb(255,255,0)&quot;&gt;Database&lt;/span&gt;
" startspan --><!--#include file="../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results ORDER BY Gotitcategory ASC"
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="4Gotiturl"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="Reference"
fp_sMenuValue="URL"
fp_sColTypes="&ID=3&Gotitcategory=202&Reference=202&Price=202&URL=202&Remote
_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan
i-checksum="14759" --><!--webbot bot="Validation"
b-disallow-first-item="TRUE" --><select NAME="URL" SIZE="1">
<option selected value="Select your Advert Page">Select your Advert Page
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn1.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="AspInclude" endspan i-checksum="1318" -->
<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn2.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="AspInclude" endspan
i-checksum="1320" --></select><!--webbot bot="DatabaseRegionEnd"
b-tableformat="FALSE" b-menuformat="TRUE"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview="
&lt;span style=&quot;color: rgb(0,0,0); background-color:
rgb(255,255,0)&quot;&gt;Results&lt;/span&gt; " startspan --><!--webbot
bot="DatabaseRegionEnd" endspan --></nobr></td>
</tr>
</table>
</td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
""..........................................................................
..............................
 
T

Thomas A. Rowe

The problem with trying to split the value, is the you don't know what the length of each item will
be,unless you include some character as a separator, that would never be used in the field content
and will not be interpreted as part of the ASP/VBScript code.

You would need to look at the following VBScript functions for splitting a string:

Left
Right
Mid

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================


Chris said:
Q::
I have a database and a form .I want the dropdown box to have multiple
fields attached to each option. That I have done with the script at the
bottom however I was wondering If anybody could help me with the following.

On submitting the selection in the form I would like the fields to be
submitted to their own database field(individually)(Split from one another)


"""""<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>"""""
would i need to change this statement
aswell???"""fp_sMenuValue="URL".............."""

These are the two fields i would like to have split into their own database
fileds on submit """URL""" and """Reference"""

If this is impossible or to technical could one use a type of script to call
just a section of the field.


Thanks to anybody taking time to answer this for me.

Cheers

Chris



......""
<nobr><!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,Gotitcategory,Reference,Price,URL,Remote_computer_name,Use
r_name,Browser_type,Timestamp"
s-columntypes="3,202,202,202,202,202,202,202,135"
s-dataconnection="4Gotiturl" b-tableformat="FALSE" b-menuformat="TRUE"
s-menuchoice="Reference" s-menuvalue="URL" b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE"
s-recordsource="Results" s-displaycolumns="Reference,URL" s-criteria
s-order="[Gotitcategory] +" s-sql="SELECT * FROM Results ORDER BY
Gotitcategory ASC" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields s-norecordsfound="" i-maxrecords="256" i-groupsize="0"
botid="1" u-dblib="../../_fpclass/fpdblib.inc"
u-dbrgn1="../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" preview=" &lt;span style=&quot;color:
rgb(0,0,0); background-color: rgb(255,255,0)&quot;&gt;Database&lt;/span&gt;
" startspan --><!--#include file="../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results ORDER BY Gotitcategory ASC"
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="4Gotiturl"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="Reference"
fp_sMenuValue="URL"
fp_sColTypes="&ID=3&Gotitcategory=202&Reference=202&Price=202&URL=202&Remote
_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan
i-checksum="14759" --><!--webbot bot="Validation"
b-disallow-first-item="TRUE" --><select NAME="URL" SIZE="1">
<option selected value="Select your Advert Page">Select your Advert Page
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn1.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="AspInclude" endspan i-checksum="1318" -->
<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn2.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="AspInclude" endspan
i-checksum="1320" --></select><!--webbot bot="DatabaseRegionEnd"
b-tableformat="FALSE" b-menuformat="TRUE"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside preview="
&lt;span style=&quot;color: rgb(0,0,0); background-color:
rgb(255,255,0)&quot;&gt;Results&lt;/span&gt; " startspan --><!--webbot
bot="DatabaseRegionEnd" endspan --></nobr></td>
</tr>
</table>
</td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
""..........................................................................
.............................
 
J

Jon Spivey

Hi,
It's usual to use the pipe (|) to split up fields, so you might have
something like
<option
value=="<%=FP_FieldHTML(fp_rs,"URL")%>|<%=FP_FieldHTML(fp_rs,"Reference")%>">

Then on the receiving page you'd do
<%
aTemp = split(request.form("DropDown"), "|")
url = aTemp(0)
reference=aTemp(1)
%>

--
Cheers,
Jon
Microsoft MVP

Chris said:
Q::
I have a database and a form .I want the dropdown box to have multiple
fields attached to each option. That I have done with the script at the
bottom however I was wondering If anybody could help me with the
following.

On submitting the selection in the form I would like the fields to be
submitted to their own database field(individually)(Split from one
another)


"""""<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>"""""
would i need to change this statement
aswell???"""fp_sMenuValue="URL".............."""

These are the two fields i would like to have split into their own
database
fileds on submit """URL""" and """Reference"""

If this is impossible or to technical could one use a type of script to
call
just a section of the field.


Thanks to anybody taking time to answer this for me.

Cheers

Chris



......""
<nobr><!--webbot bot="DatabaseRegionStart"
s-columnnames="ID,Gotitcategory,Reference,Price,URL,Remote_computer_name,Use
r_name,Browser_type,Timestamp"
s-columntypes="3,202,202,202,202,202,202,202,135"
s-dataconnection="4Gotiturl" b-tableformat="FALSE" b-menuformat="TRUE"
s-menuchoice="Reference" s-menuvalue="URL" b-tableborder="TRUE"
b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE"
b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE"
s-recordsource="Results" s-displaycolumns="Reference,URL" s-criteria
s-order="[Gotitcategory] +" s-sql="SELECT * FROM Results ORDER BY
Gotitcategory ASC" b-procedure="FALSE" clientside suggestedext="asp"
s-defaultfields s-norecordsfound="" i-maxrecords="256" i-groupsize="0"
botid="1" u-dblib="../../_fpclass/fpdblib.inc"
u-dbrgn1="../../_fpclass/fpdbrgn1.inc"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" preview=" &lt;span
style=&quot;color:
rgb(0,0,0); background-color:
rgb(255,255,0)&quot;&gt;Database&lt;/span&gt;
" startspan --><!--#include file="../../_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The
Database
Results component on this page is unable to display database content. The
page must have a filename ending in '.asp', and the web must be hosted on
a
server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Results ORDER BY Gotitcategory ASC"
fp_sDefault=""
fp_sNoRecords=""
fp_sDataConn="4Gotiturl"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=True
fp_sMenuChoice="Reference"
fp_sMenuValue="URL"
fp_sColTypes="&ID=3&Gotitcategory=202&Reference=202&Price=202&URL=202&Remote
_computer_name=202&User_name=202&Browser_type=202&Timestamp=135&"
fp_iDisplayCols=2
fp_fCustomQuery=False
BOTID=1
fp_iRegion=BOTID
%>
<!--webbot bot="DatabaseRegionStart" endspan
i-checksum="14759" --><!--webbot bot="Validation"
b-disallow-first-item="TRUE" --><select NAME="URL" SIZE="1">
<option selected value="Select your Advert Page">Select your Advert Page
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn1.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="AspInclude" endspan i-checksum="1318" -->
<option
VALUE="<%=FP_FieldHTML(fp_rs,"URL")%>,<%=FP_FieldHTML(fp_rs,"Reference")%>">
<%=FP_FieldHTML(fp_rs,"Reference")%>
</option>
<!--webbot bot="AspInclude" clientside
u-incfile="../../_fpclass/fpdbrgn2.inc" startspan --><!--#include
file="../../_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="AspInclude" endspan
i-checksum="1320" --></select><!--webbot bot="DatabaseRegionEnd"
b-tableformat="FALSE" b-menuformat="TRUE"
u-dbrgn2="../../_fpclass/fpdbrgn2.inc" i-groupsize="0" clientside
preview="
&lt;span style=&quot;color: rgb(0,0,0); background-color:
rgb(255,255,0)&quot;&gt;Results&lt;/span&gt; " startspan --><!--webbot
bot="DatabaseRegionEnd" endspan --></nobr></td>
</tr>
</table>
</td>
</tr>
</table>
<p><input type="submit" value="Submit" name="B1"></p>
</form>
""..........................................................................
.............................
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top