Results 1 to 5 of 5

Thread: Please help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Springfield
    Posts
    120

    Please help

    why this list box does not work???
    This is the code I create below, but it does not work. I got error message for this line Response.Write(Request.Form("LST1")(1)) , index out of range. Thanks very much


    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>
    <form action="test2.asp" method="post">
    First name:
    <input name="fname" value="Donald" >
    <br>
    Last name:
    <input name="lname" value="Duck" >
    <P> </P>
    <P><SELECT id=LST1 name=LST1 size=2 style="HEIGHT: 153px; WIDTH: 228px" ><OPTION
    value=TTTT>TTT<OPTION value=WWW>WWW


    </SELECT></P>
    <P>
    <br>
    <input type="submit" value="submit"> </P>
    </form>
    <%
    Response.Write(Request.Form("LST1")(1))
    %>

    <P> </P>

    </BODY>
    </HTML>
    MM

  2. #2
    Addicted Member ShIzO's Avatar
    Join Date
    Apr 1999
    Location
    Bartlett, IL
    Posts
    189
    is this page called "test2.asp" ?
    or you've got another one called test2.asp?
    www.HardFind.com -buy/sell/trade your used hardware.

  3. #3
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Red face

    If you are using ASP, then I suggest you ignore the index value. You should get the correct values separated with a comma.

    abhijit

    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  4. #4
    Addicted Member ShIzO's Avatar
    Join Date
    Apr 1999
    Location
    Bartlett, IL
    Posts
    189
    if the page you showed us posts to itself, then you will get an error because of this line

    Code:
    Response.Write(Request.Form("LST1")(1))
    when the page goes through first time the Request.Form("LST") object doesn't exist (thus it doesn't contain Index Property), it only exists after the page posts to itself...

    so you have to check if page goes first or second time through
    www.HardFind.com -buy/sell/trade your used hardware.

  5. #5
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    I answered this in another thread. How many did you post for this same problem????

    Grr!
    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..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width