Home All Groups Group Topic Archive Search About

How to pass a code of a list box to a processing form



Author
1 Mar 2006 11:19 PM
Jack
Hi,
I have a asp form where one element is a list box which lists four years
starting from 2004. This list is drawn from a database table which has YearID
and Year as two fields as shown below:
     YearID    YEAR
     1            2004
     2            2005
     3            2006
     4            2007
PART OF ASP CODE IS:

<tr>
    <td width="74%" align ="center" height="18"><font face="Times New Roman"
size="3" color = "red">YEAR</font></td>
    <td>
    <SELECT NAME="lstYear"  SIZE="1">

     <% Do while not RS_Year.EOF
        Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
        Response.Write RS_Year("YEAR") & "</OPTION>"
        RS_Year.MoveNext
       Loop
      %>
     <td>
<tr>

   Now I want to capture the value of the YearCode instead of the Year field
and store the year code value in the processing form to process in a sql
statement.

i.e. I am planning to use the  Request.Form("lstYear") to capture the value
of the  year code. However, Request.Form("listYear") is showing no value.
I would appreciate any help or any article link for handling this problem.
Thank in advance.

Author
1 Mar 2006 11:37 PM
Bob Barrows [MVP]
Jack wrote:
Show quote
> Hi,
> I have a asp form where one element is a list box which lists four
> years starting from 2004. This list is drawn from a database table
> which has YearID and Year as two fields as shown below:
>      YearID YEAR
>      1         2004
>      2         2005
>      3         2006
>      4         2007
> PART OF ASP CODE IS:
>
>  <tr>
> <td width="74%" align ="center" height="18"><font face="Times New
> Roman" size="3" color = "red">YEAR</font></td>
>     <td>
>     <SELECT NAME="lstYear"  SIZE="1">
>
>      <% Do while not RS_Year.EOF
>         Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
>         Response.Write RS_Year("YEAR") & "</OPTION>"
>         RS_Year.MoveNext
>        Loop
>       %>
>      <td>
>  <tr>
>
>    Now I want to capture the value of the YearCode instead of the

So why are you using RS_Year("YEAR") for the option value? Wouldn't it make
more sense to change it to:

Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"


> Year field and store the year code value in the processing form to
> process in a sql statement.
>
> i.e. I am planning to use the  Request.Form("lstYear") to capture the
> value of the  year code. However, Request.Form("listYear") is showing
> no value.

At what point in the process? After you submitted form containing the above
SELECT element?

Create a small test form that reproduces the problem and post the entire
code from that SMALL test form.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
2 Mar 2006 12:04 AM
Jack
Thanks Bob for your help. I am going to do that. However, the reason I am using
RS_Year("YEAR") for the option value is that I want to display all the YEAR
values in the the list box on the  form. However,  instead of Year I need to
capture the value of the corresponding code of the YEAR. This code goes to
the sql statement in the processing asp page. Thanks.

Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"


Show quote
"Bob Barrows [MVP]" wrote:

> Jack wrote:
> > Hi,
> > I have a asp form where one element is a list box which lists four
> > years starting from 2004. This list is drawn from a database table
> > which has YearID and Year as two fields as shown below:
> >      YearID YEAR
> >      1         2004
> >      2         2005
> >      3         2006
> >      4         2007
> > PART OF ASP CODE IS:
> >
> >  <tr>
> > <td width="74%" align ="center" height="18"><font face="Times New
> > Roman" size="3" color = "red">YEAR</font></td>
> >     <td>
> >     <SELECT NAME="lstYear"  SIZE="1">
> >
> >      <% Do while not RS_Year.EOF
> >         Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
> >         Response.Write RS_Year("YEAR") & "</OPTION>"
> >         RS_Year.MoveNext
> >        Loop
> >       %>
> >      <td>
> >  <tr>
> >
> >    Now I want to capture the value of the YearCode instead of the
>
> So why are you using RS_Year("YEAR") for the option value? Wouldn't it make
> more sense to change it to:
>
> Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
>
>
> > Year field and store the year code value in the processing form to
> > process in a sql statement.
> >
> > i.e. I am planning to use the  Request.Form("lstYear") to capture the
> > value of the  year code. However, Request.Form("listYear") is showing
> > no value.
>
> At what point in the process? After you submitted form containing the above
> SELECT element?
>
> Create a small test form that reproduces the problem and post the entire
> code from that SMALL test form.
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>
Author
2 Mar 2006 12:22 AM
Jack
Well Bob, I just trimmed my code to get a test asp page. Here please note
that the tblYear has YearId and Year field. I need to display the Year Value,
yet capture the YearId(ie. the selected one from the list box) in the
processing form using request object. This YearId will go the sql statement
in the processing form.This is the main issue to me ie. how to display one
field in the list box yet capture the corresponding ID from the form in the
processing asp page using request form object. Hope I could explain well.
Here is the code for the test page. Thanks. Regards,

<!-- #include file="connection.asp" -->
<!-- #include file="adovbs.inc" -->

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>

<center>
<h2>
<b>
<font size="5" color="navy">
TEST
</font>
</b>
</h2>
</center>

<BODY>




<%
   Set RS_Year = Server.CreateObject("ADODB.Recordset")



     strSQL3 = "SELECT YearId, Year FROM tblYear"
        RS_Year.Open strSQL3, conn      

%>
<form method=POST name="frm_mainentry" action="mainentry_process.asp"
onSubmit>
<div align="center">
<table border = "1" width="80%" height="1" cellspacing = "1">


    <tr>
    <td width="50%" align ="center" height="18"><font face="Times New Roman"
size="3" color = "red">COUNT TOTAL OFFENSES</font></td>
    <td width="50%" align="center" BGCOLOR="white" height="18"><font
face="Times New Roman" size="1">   
    <input type="text" name="txt_CountTotalOffenses" size="57" 
style="font-family: Times New Roman; font-size: 12pt"></font></td>
  </tr>
  <%'Response.End%>

       <tr>
    <td width="74%" align ="center" height="18"><font face="Times New Roman"
size="3" color = "red">YEAR</font></td>
    <td>
    <SELECT NAME="lstYear"  SIZE="1">

     <% Do while not RS_Year.EOF
        Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
        Response.Write RS_Year("YEAR") & "</OPTION>"
        RS_Year.MoveNext
       Loop
      %>
     <td>
     <tr>
  <%'Response.End%>

  <tr>
      <td width="100%" align="right" colspan = "2" height="27"><p><input
type="submit" value="Submit" name="B3"></td>
  </tr>

</table>
</div>
</form>

</BODY>
</HTML>



Show quote
"Jack" wrote:

> Thanks Bob for your help. I am going to do that. However, the reason I am using
> RS_Year("YEAR") for the option value is that I want to display all the YEAR
> values in the the list box on the  form. However,  instead of Year I need to
> capture the value of the corresponding code of the YEAR. This code goes to
> the sql statement in the processing asp page. Thanks.
>
> Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
>
>
> "Bob Barrows [MVP]" wrote:
>
> > Jack wrote:
> > > Hi,
> > > I have a asp form where one element is a list box which lists four
> > > years starting from 2004. This list is drawn from a database table
> > > which has YearID and Year as two fields as shown below:
> > >      YearID YEAR
> > >      1         2004
> > >      2         2005
> > >      3         2006
> > >      4         2007
> > > PART OF ASP CODE IS:
> > >
> > >  <tr>
> > > <td width="74%" align ="center" height="18"><font face="Times New
> > > Roman" size="3" color = "red">YEAR</font></td>
> > >     <td>
> > >     <SELECT NAME="lstYear"  SIZE="1">
> > >
> > >      <% Do while not RS_Year.EOF
> > >         Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
> > >         Response.Write RS_Year("YEAR") & "</OPTION>"
> > >         RS_Year.MoveNext
> > >        Loop
> > >       %>
> > >      <td>
> > >  <tr>
> > >
> > >    Now I want to capture the value of the YearCode instead of the
> >
> > So why are you using RS_Year("YEAR") for the option value? Wouldn't it make
> > more sense to change it to:
> >
> > Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
> >
> >
> > > Year field and store the year code value in the processing form to
> > > process in a sql statement.
> > >
> > > i.e. I am planning to use the  Request.Form("lstYear") to capture the
> > > value of the  year code. However, Request.Form("listYear") is showing
> > > no value.
> >
> > At what point in the process? After you submitted form containing the above
> > SELECT element?
> >
> > Create a small test form that reproduces the problem and post the entire
> > code from that SMALL test form.
> >
> > --
> > Microsoft MVP -- ASP/ASP.NET
> > Please reply to the newsgroup. The email account listed in my From
> > header is my spam trap, so I don't check it very often. You will get a
> > quicker response by posting to the newsgroup.
> >
> >
> >
Author
2 Mar 2006 2:10 PM
Bob Barrows [MVP]
Jack wrote:
> Well Bob, I just trimmed my code to get a test asp page.

:-)
Obviously, you and i have different ideas about what constitutes a "small"
test page ;-)

> Here please
> note that the tblYear has YearId and Year field. I need to display
> the Year Value, yet capture the YearId(ie. the selected one from the
> list box) in the processing form using request object. This YearId
> will go the sql statement in the processing form.This is the main
> issue to me ie. how to display one field in the list box yet capture
> the corresponding ID from the form in the processing asp page using
> request form object. Hope I could explain well. Here is the code for
> the test page. Thanks. Regards,
>

This is why I told you to set the value attribut to the YearID instead of
the Year. here, try this to see:


<!-- #include file="connection.asp" -->
<!-- #include file="adovbs.inc" -->
<%
strSQL3 = "SELECT YearId, Year FROM tblYear"
Set RS_Year =conn.execute(strsql3,,1)
if not rs_year.eof then arData=rs_year.getrows
rs_year.close:set rs_year=nothing
conn.close: set conn=nothing
sHTML=""
if isarray(ardata) then
    for i = 0 to ubound(ardata,2)
        shtml = shtml & "<option value = """ & _
            ardata(0,i) & """>" & ardata(1,i) & "</option>"
    next
end if
if len(request.form("lstYear")) > 0 then
    response.write "The value of the option you selected is """ & _
        request.form("lstYear")
end if
%>
<html><body><form method=POST >
<SELECT NAME= "lstYear"  SIZE="1">
<%=shtml%>
</SELECT>
<input type="submit" value="Submit" >
</form></body></html>

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
2 Mar 2006 1:43 AM
Bob Barrows [MVP]
Jack wrote:
> Thanks Bob for your help. I am going to do that. However, the reason
> I am using RS_Year("YEAR") for the option value is that I want to
> display all the YEAR values in the the list box on the  form.

The Value is not displayed, the text is. Try it.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Author
2 Mar 2006 2:13 AM
Jack
Bob, Actually I meant the text Year is displayed which is fine. The user need
to click on the Year (e.g. 2004) to choose from the list. However, as I
pointed out earlier that though 2004 is click I need to capture the
corresponding YearID which is 1 in the present case (i.e. the year 2004 is
chosen). Hope I am more clear now. I have got the sample code here. Any
thoughts.

Show quote
"Bob Barrows [MVP]" wrote:

> Jack wrote:
> > Thanks Bob for your help. I am going to do that. However, the reason
> > I am using RS_Year("YEAR") for the option value is that I want to
> > display all the YEAR values in the the list box on the  form.
>
> The Value is not displayed, the text is. Try it.
>
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"
>
>
>
Author
2 Mar 2006 2:00 AM
Bob Lehmann
I'm curious.

Since each year only happens once, why do you have a yearID column? I'm not
even really sure why you have a year table to begin with.

Unless you know something......

Bob Lehmann

Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:D4C0BC42-583B-4F51-8A8A-160FA1E90E4C@microsoft.com...
> Thanks Bob for your help. I am going to do that. However, the reason I am
using
> RS_Year("YEAR") for the option value is that I want to display all the
YEAR
> values in the the list box on the  form. However,  instead of Year I need
to
> capture the value of the corresponding code of the YEAR. This code goes to
> the sql statement in the processing asp page. Thanks.
>
> Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
>
>
> "Bob Barrows [MVP]" wrote:
>
> > Jack wrote:
> > > Hi,
> > > I have a asp form where one element is a list box which lists four
> > > years starting from 2004. This list is drawn from a database table
> > > which has YearID and Year as two fields as shown below:
> > >      YearID YEAR
> > >      1         2004
> > >      2         2005
> > >      3         2006
> > >      4         2007
> > > PART OF ASP CODE IS:
> > >
> > >  <tr>
> > > <td width="74%" align ="center" height="18"><font face="Times New
> > > Roman" size="3" color = "red">YEAR</font></td>
> > >     <td>
> > >     <SELECT NAME="lstYear"  SIZE="1">
> > >
> > >      <% Do while not RS_Year.EOF
> > >         Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
> > >         Response.Write RS_Year("YEAR") & "</OPTION>"
> > >         RS_Year.MoveNext
> > >        Loop
> > >       %>
> > >      <td>
> > >  <tr>
> > >
> > >    Now I want to capture the value of the YearCode instead of the
> >
> > So why are you using RS_Year("YEAR") for the option value? Wouldn't it
make
> > more sense to change it to:
> >
> > Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
> >
> >
> > > Year field and store the year code value in the processing form to
> > > process in a sql statement.
> > >
> > > i.e. I am planning to use the  Request.Form("lstYear") to capture the
> > > value of the  year code. However, Request.Form("listYear") is showing
> > > no value.
> >
> > At what point in the process? After you submitted form containing the
above
> > SELECT element?
> >
> > Create a small test form that reproduces the problem and post the entire
> > code from that SMALL test form.
> >
> > --
> > Microsoft MVP -- ASP/ASP.NET
> > Please reply to the newsgroup. The email account listed in my From
> > header is my spam trap, so I don't check it very often. You will get a
> > quicker response by posting to the newsgroup.
> >
> >
> >
Author
2 Mar 2006 2:16 AM
Jack
OK,
this is just a test. In reality this is a much bigger data entry form where
various parties will enter 2004 and 2005 data via the web application. The
Year list box helps them to have their choice instead of typing the value in.
In the final table where all the data is collected the YearID is collected
rather than the YEAR text. Hope I am little more clear. Thanks

Show quote
"Bob Lehmann" wrote:

> I'm curious.
>
> Since each year only happens once, why do you have a yearID column? I'm not
> even really sure why you have a year table to begin with.
>
> Unless you know something......
>
> Bob Lehmann
>
> "Jack" <J***@discussions.microsoft.com> wrote in message
> news:D4C0BC42-583B-4F51-8A8A-160FA1E90E4C@microsoft.com...
> > Thanks Bob for your help. I am going to do that. However, the reason I am
> using
> > RS_Year("YEAR") for the option value is that I want to display all the
> YEAR
> > values in the the list box on the  form. However,  instead of Year I need
> to
> > capture the value of the corresponding code of the YEAR. This code goes to
> > the sql statement in the processing asp page. Thanks.
> >
> > Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
> >
> >
> > "Bob Barrows [MVP]" wrote:
> >
> > > Jack wrote:
> > > > Hi,
> > > > I have a asp form where one element is a list box which lists four
> > > > years starting from 2004. This list is drawn from a database table
> > > > which has YearID and Year as two fields as shown below:
> > > >      YearID YEAR
> > > >      1         2004
> > > >      2         2005
> > > >      3         2006
> > > >      4         2007
> > > > PART OF ASP CODE IS:
> > > >
> > > >  <tr>
> > > > <td width="74%" align ="center" height="18"><font face="Times New
> > > > Roman" size="3" color = "red">YEAR</font></td>
> > > >     <td>
> > > >     <SELECT NAME="lstYear"  SIZE="1">
> > > >
> > > >      <% Do while not RS_Year.EOF
> > > >         Response.Write "<Option Value='" & RS_Year("YEAR")& "'>"
> > > >         Response.Write RS_Year("YEAR") & "</OPTION>"
> > > >         RS_Year.MoveNext
> > > >        Loop
> > > >       %>
> > > >      <td>
> > > >  <tr>
> > > >
> > > >    Now I want to capture the value of the YearCode instead of the
> > >
> > > So why are you using RS_Year("YEAR") for the option value? Wouldn't it
> make
> > > more sense to change it to:
> > >
> > > Response.Write "<Option Value='" & RS_Year("YEARID")& "'>"
> > >
> > >
> > > > Year field and store the year code value in the processing form to
> > > > process in a sql statement.
> > > >
> > > > i.e. I am planning to use the  Request.Form("lstYear") to capture the
> > > > value of the  year code. However, Request.Form("listYear") is showing
> > > > no value.
> > >
> > > At what point in the process? After you submitted form containing the
> above
> > > SELECT element?
> > >
> > > Create a small test form that reproduces the problem and post the entire
> > > code from that SMALL test form.
> > >
> > > --
> > > Microsoft MVP -- ASP/ASP.NET
> > > Please reply to the newsgroup. The email account listed in my From
> > > header is my spam trap, so I don't check it very often. You will get a
> > > quicker response by posting to the newsgroup.
> > >
> > >
> > >
>
>
>
Author
2 Mar 2006 8:25 AM
Mike Brind
Jack wrote:
> OK,
> this is just a test. In reality this is a much bigger data entry form where
> various parties will enter 2004 and 2005 data via the web application. The
> Year list box helps them to have their choice instead of typing the value in.
> In the final table where all the data is collected the YearID is collected
> rather than the YEAR text. Hope I am little more clear. Thanks
>

As Bob has already pointed out a couple of times, with a Select list,
the value is passed with the form or querystring collection.  So this:

<option value="somevalue">Some Text</option>

will display "Some Text" on the screen, but if it is selected, will
pass "somevalue" to the collection.  The only time "Some Text" will be
passed is if you either leave the option value blank, or explicitly
define the value as "Some Text".  The latter is in effect what you are
doing with RS("Year").

Consequently, Bob's code will work in exactly the way you want it to.
Try the test as he suggested.

--
Mike Brind
Author
2 Mar 2006 3:26 PM
Jack
This is a message for Bob.
I am still not clear about the whole thing yert. Bob, I have posted the code
using small test asp page as per your advise. Could you please let me know in
the test code what exactly is wrong? Can you show me couple of lines of code
in the test code to capture the chosen year (actually to capture yeardID)
using request.form. Thanks.

Show quote
"Mike Brind" wrote:

>
> Jack wrote:
> > OK,
> > this is just a test. In reality this is a much bigger data entry form where
> > various parties will enter 2004 and 2005 data via the web application. The
> > Year list box helps them to have their choice instead of typing the value in.
> > In the final table where all the data is collected the YearID is collected
> > rather than the YEAR text. Hope I am little more clear. Thanks
> >
>
> As Bob has already pointed out a couple of times, with a Select list,
> the value is passed with the form or querystring collection.  So this:
>
> <option value="somevalue">Some Text</option>
>
> will display "Some Text" on the screen, but if it is selected, will
> pass "somevalue" to the collection.  The only time "Some Text" will be
> passed is if you either leave the option value blank, or explicitly
> define the value as "Some Text".  The latter is in effect what you are
> doing with RS("Year").
>
> Consequently, Bob's code will work in exactly the way you want it to.
> Try the test as he suggested.
>
> --
> Mike Brind
>
>
Author
2 Mar 2006 3:51 PM
Bob Barrows [MVP]
Jack, did you try the test page i posted?

Jack wrote:
Show quote
> This is a message for Bob.
> I am still not clear about the whole thing yert. Bob, I have posted
> the code using small test asp page as per your advise. Could you
> please let me know in the test code what exactly is wrong? Can you
> show me couple of lines of code in the test code to capture the
> chosen year (actually to capture yeardID) using request.form. Thanks.
>
> "Mike Brind" wrote:
>
>>
>> Jack wrote:
>>> OK,
>>> this is just a test. In reality this is a much bigger data entry
>>> form where various parties will enter 2004 and 2005 data via the
>>> web application. The Year list box helps them to have their choice
>>> instead of typing the value in. In the final table where all the
>>> data is collected the YearID is collected rather than the YEAR
>>> text. Hope I am little more clear. Thanks
>>>
>>
>> As Bob has already pointed out a couple of times, with a Select list,
>> the value is passed with the form or querystring collection.  So
>> this:
>>
>> <option value="somevalue">Some Text</option>
>>
>> will display "Some Text" on the screen, but if it is selected, will
>> pass "somevalue" to the collection.  The only time "Some Text" will
>> be passed is if you either leave the option value blank, or
>> explicitly define the value as "Some Text".  The latter is in effect
>> what you are doing with RS("Year").
>>
>> Consequently, Bob's code will work in exactly the way you want it to.
>> Try the test as he suggested.
>>
>> --
>> Mike Brind

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
2 Mar 2006 4:28 PM
Jack
Sorry Bob,
I overlooked the code you posted. I apologize for it. I am going to try
it.Regards.

Show quote
"Bob Barrows [MVP]" wrote:

> Jack, did you try the test page i posted?
>
> Jack wrote:
> > This is a message for Bob.
> > I am still not clear about the whole thing yert. Bob, I have posted
> > the code using small test asp page as per your advise. Could you
> > please let me know in the test code what exactly is wrong? Can you
> > show me couple of lines of code in the test code to capture the
> > chosen year (actually to capture yeardID) using request.form. Thanks.
> >
> > "Mike Brind" wrote:
> >
> >>
> >> Jack wrote:
> >>> OK,
> >>> this is just a test. In reality this is a much bigger data entry
> >>> form where various parties will enter 2004 and 2005 data via the
> >>> web application. The Year list box helps them to have their choice
> >>> instead of typing the value in. In the final table where all the
> >>> data is collected the YearID is collected rather than the YEAR
> >>> text. Hope I am little more clear. Thanks
> >>>
> >>
> >> As Bob has already pointed out a couple of times, with a Select list,
> >> the value is passed with the form or querystring collection.  So
> >> this:
> >>
> >> <option value="somevalue">Some Text</option>
> >>
> >> will display "Some Text" on the screen, but if it is selected, will
> >> pass "somevalue" to the collection.  The only time "Some Text" will
> >> be passed is if you either leave the option value blank, or
> >> explicitly define the value as "Some Text".  The latter is in effect
> >> what you are doing with RS("Year").
> >>
> >> Consequently, Bob's code will work in exactly the way you want it to.
> >> Try the test as he suggested.
> >>
> >> --
> >> Mike Brind
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>
Author
2 Mar 2006 8:38 PM
Jack
Hi Bob,
I tried your code and it works now. Thanks a lot for the generous help. Best
regards.

Show quote
"Jack" wrote:

> Sorry Bob,
> I overlooked the code you posted. I apologize for it. I am going to try
> it.Regards.
>
> "Bob Barrows [MVP]" wrote:
>
> > Jack, did you try the test page i posted?
> >
> > Jack wrote:
> > > This is a message for Bob.
> > > I am still not clear about the whole thing yert. Bob, I have posted
> > > the code using small test asp page as per your advise. Could you
> > > please let me know in the test code what exactly is wrong? Can you
> > > show me couple of lines of code in the test code to capture the
> > > chosen year (actually to capture yeardID) using request.form. Thanks.
> > >
> > > "Mike Brind" wrote:
> > >
> > >>
> > >> Jack wrote:
> > >>> OK,
> > >>> this is just a test. In reality this is a much bigger data entry
> > >>> form where various parties will enter 2004 and 2005 data via the
> > >>> web application. The Year list box helps them to have their choice
> > >>> instead of typing the value in. In the final table where all the
> > >>> data is collected the YearID is collected rather than the YEAR
> > >>> text. Hope I am little more clear. Thanks
> > >>>
> > >>
> > >> As Bob has already pointed out a couple of times, with a Select list,
> > >> the value is passed with the form or querystring collection.  So
> > >> this:
> > >>
> > >> <option value="somevalue">Some Text</option>
> > >>
> > >> will display "Some Text" on the screen, but if it is selected, will
> > >> pass "somevalue" to the collection.  The only time "Some Text" will
> > >> be passed is if you either leave the option value blank, or
> > >> explicitly define the value as "Some Text".  The latter is in effect
> > >> what you are doing with RS("Year").
> > >>
> > >> Consequently, Bob's code will work in exactly the way you want it to.
> > >> Try the test as he suggested.
> > >>
> > >> --
> > >> Mike Brind
> >
> > --
> > Microsoft MVP -- ASP/ASP.NET
> > Please reply to the newsgroup. The email account listed in my From
> > header is my spam trap, so I don't check it very often. You will get a
> > quicker response by posting to the newsgroup.
> >
> >
> >
Author
2 Mar 2006 8:44 PM
Bob Barrows [MVP]
I guess the key question now is: do you understand why it works when your
original didn't?

Jack wrote:
Show quote
> Hi Bob,
> I tried your code and it works now. Thanks a lot for the generous
> help. Best regards.
>
> "Jack" wrote:
>
>> Sorry Bob,
>> I overlooked the code you posted. I apologize for it. I am going to
>> try it.Regards.
>>
>> "Bob Barrows [MVP]" wrote:
>>
>>> Jack, did you try the test page i posted?
>>>
>>> Jack wrote:
>>>> This is a message for Bob.
>>>> I am still not clear about the whole thing yert. Bob, I have posted
>>>> the code using small test asp page as per your advise. Could you
>>>> please let me know in the test code what exactly is wrong? Can you
>>>> show me couple of lines of code in the test code to capture the
>>>> chosen year (actually to capture yeardID) using request.form.
>>>> Thanks.
>>>>
>>>> "Mike Brind" wrote:
>>>>
>>>>>
>>>>> Jack wrote:
>>>>>> OK,
>>>>>> this is just a test. In reality this is a much bigger data entry
>>>>>> form where various parties will enter 2004 and 2005 data via the
>>>>>> web application. The Year list box helps them to have their
>>>>>> choice instead of typing the value in. In the final table where
>>>>>> all the data is collected the YearID is collected rather than
>>>>>> the YEAR text. Hope I am little more clear. Thanks
>>>>>>
>>>>>
>>>>> As Bob has already pointed out a couple of times, with a Select
>>>>> list, the value is passed with the form or querystring
>>>>> collection.  So this:
>>>>>
>>>>> <option value="somevalue">Some Text</option>
>>>>>
>>>>> will display "Some Text" on the screen, but if it is selected,
>>>>> will pass "somevalue" to the collection.  The only time "Some
>>>>> Text" will be passed is if you either leave the option value
>>>>> blank, or explicitly define the value as "Some Text".  The latter
>>>>> is in effect what you are doing with RS("Year").
>>>>>
>>>>> Consequently, Bob's code will work in exactly the way you want it
>>>>> to. Try the test as he suggested.
>>>>>
>>>>> --
>>>>> Mike Brind
>>>
>>> --
>>> Microsoft MVP -- ASP/ASP.NET
>>> Please reply to the newsgroup. The email account listed in my From
>>> header is my spam trap, so I don't check it very often. You will
>>> get a quicker response by posting to the newsgroup.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Author
3 Mar 2006 5:10 PM
Jack
Bob, I am clear on the concept now. Thanks. Regards.

Show quote
"Bob Barrows [MVP]" wrote:

> I guess the key question now is: do you understand why it works when your
> original didn't?
>
> Jack wrote:
> > Hi Bob,
> > I tried your code and it works now. Thanks a lot for the generous
> > help. Best regards.
> >
> > "Jack" wrote:
> >
> >> Sorry Bob,
> >> I overlooked the code you posted. I apologize for it. I am going to
> >> try it.Regards.
> >>
> >> "Bob Barrows [MVP]" wrote:
> >>
> >>> Jack, did you try the test page i posted?
> >>>
> >>> Jack wrote:
> >>>> This is a message for Bob.
> >>>> I am still not clear about the whole thing yert. Bob, I have posted
> >>>> the code using small test asp page as per your advise. Could you
> >>>> please let me know in the test code what exactly is wrong? Can you
> >>>> show me couple of lines of code in the test code to capture the
> >>>> chosen year (actually to capture yeardID) using request.form.
> >>>> Thanks.
> >>>>
> >>>> "Mike Brind" wrote:
> >>>>
> >>>>>
> >>>>> Jack wrote:
> >>>>>> OK,
> >>>>>> this is just a test. In reality this is a much bigger data entry
> >>>>>> form where various parties will enter 2004 and 2005 data via the
> >>>>>> web application. The Year list box helps them to have their
> >>>>>> choice instead of typing the value in. In the final table where
> >>>>>> all the data is collected the YearID is collected rather than
> >>>>>> the YEAR text. Hope I am little more clear. Thanks
> >>>>>>
> >>>>>
> >>>>> As Bob has already pointed out a couple of times, with a Select
> >>>>> list, the value is passed with the form or querystring
> >>>>> collection.  So this:
> >>>>>
> >>>>> <option value="somevalue">Some Text</option>
> >>>>>
> >>>>> will display "Some Text" on the screen, but if it is selected,
> >>>>> will pass "somevalue" to the collection.  The only time "Some
> >>>>> Text" will be passed is if you either leave the option value
> >>>>> blank, or explicitly define the value as "Some Text".  The latter
> >>>>> is in effect what you are doing with RS("Year").
> >>>>>
> >>>>> Consequently, Bob's code will work in exactly the way you want it
> >>>>> to. Try the test as he suggested.
> >>>>>
> >>>>> --
> >>>>> Mike Brind
> >>>
> >>> --
> >>> Microsoft MVP -- ASP/ASP.NET
> >>> Please reply to the newsgroup. The email account listed in my From
> >>> header is my spam trap, so I don't check it very often. You will
> >>> get a quicker response by posting to the newsgroup.
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
>

AddThis Social Bookmark Button