Newbie Forms

Discussion in 'ASP General' started by TNGgroup, Dec 1, 2004.

  1. TNGgroup

    TNGgroup Guest

    Hi,

    I have a problem with some forms. I created 2 pages, one (list.asp) is an
    overview of all my record. for each record I put a button. When I click the
    button I would like a second asp page (edit.asp) to open with that specific
    record. This is a part code of my list.asp. the link should be based upon
    contact_id.

    But he is always showing the first record ??

    Thx

    TNG


    <%Do While Not objRS.EOF%>

    <tr>
    <td><b>Item / Company</b><font
    color="#330099">&nbsp;<%=objRS("contact_item")%></font></p></td>
    <td><b>Contact</b><font
    color="#330099">&nbsp;<%=objRS("contact_name")%></font></td>
    <td><b>Country</b><font
    color="#330099">&nbsp;<%=objRS("ItC_Country")%></font></td>
    <td valign="top">
    <form action="edit.asp" method="post" name="form_edit" target="_self">
    <input name="" type="text" value="<%=objRS("contact_id")%>" size="2">
    <input name="Edit" type="submit" class="content" value="Edit this
    contact">
    </form>
    </tr>
    <tr><TD colspan="3"><hr>
    </TD>
    </tr>

    <%objRS.movenext
    Loop%>
     
    TNGgroup, Dec 1, 2004
    #1
    1. Advertising

  2. TNGgroup

    Jeff Cochran Guest

    On Wed, 1 Dec 2004 15:58:53 +0100, "TNGgroup" <>
    wrote:

    >Hi,
    >
    >I have a problem with some forms. I created 2 pages, one (list.asp) is an
    >overview of all my record. for each record I put a button. When I click the
    >button I would like a second asp page (edit.asp) to open with that specific
    >record. This is a part code of my list.asp. the link should be based upon
    >contact_id.
    >
    >But he is always showing the first record ??


    Looks like you create a new form for each loop, so in essence you're
    running dozens of identical forms, all with the same ID. Your submit
    picks the first instance on the page.

    Drop the idea of forms and create these as simple links then, if you
    need to, link those with a button.

    Jeff


    > <%Do While Not objRS.EOF%>
    >
    > <tr>
    > <td><b>Item / Company</b><font
    >color="#330099">&nbsp;<%=objRS("contact_item")%></font></p></td>
    > <td><b>Contact</b><font
    >color="#330099">&nbsp;<%=objRS("contact_name")%></font></td>
    > <td><b>Country</b><font
    >color="#330099">&nbsp;<%=objRS("ItC_Country")%></font></td>
    > <td valign="top">
    > <form action="edit.asp" method="post" name="form_edit" target="_self">
    > <input name="" type="text" value="<%=objRS("contact_id")%>" size="2">
    > <input name="Edit" type="submit" class="content" value="Edit this
    >contact">
    > </form>
    > </tr>
    > <tr><TD colspan="3"><hr>
    > </TD>
    > </tr>
    >
    > <%objRS.movenext
    > Loop%>
    >
    >
    >
    >
    >
    >
     
    Jeff Cochran, Dec 1, 2004
    #2
    1. Advertising

  3. TNGgroup

    Tom B Guest

    This should work, although I personally prefer the suggestion that Jeff
    gave.
    The problem I think you have is that you haven't given a name to your
    ContactId text field.
    <input name="" type="text" value="<%=objRS("contact_id")%>" size="2">
    should be
    <input name="ContactId" type="text" value="<%=objRS("contact_id")%>"
    size="2">
    TomB

    "TNGgroup" <> wrote in message
    news:41addc1a$0$9316$...
    > Hi,
    >
    > I have a problem with some forms. I created 2 pages, one (list.asp) is an
    > overview of all my record. for each record I put a button. When I click

    the
    > button I would like a second asp page (edit.asp) to open with that

    specific
    > record. This is a part code of my list.asp. the link should be based upon
    > contact_id.
    >
    > But he is always showing the first record ??
    >
    > Thx
    >
    > TNG
    >
    >
    > <%Do While Not objRS.EOF%>
    >
    > <tr>
    > <td><b>Item / Company</b><font
    > color="#330099">&nbsp;<%=objRS("contact_item")%></font></p></td>
    > <td><b>Contact</b><font
    > color="#330099">&nbsp;<%=objRS("contact_name")%></font></td>
    > <td><b>Country</b><font
    > color="#330099">&nbsp;<%=objRS("ItC_Country")%></font></td>
    > <td valign="top">
    > <form action="edit.asp" method="post" name="form_edit"

    target="_self">
    > <input name="" type="text" value="<%=objRS("contact_id")%>" size="2">
    > <input name="Edit" type="submit" class="content" value="Edit this
    > contact">
    > </form>
    > </tr>
    > <tr><TD colspan="3"><hr>
    > </TD>
    > </tr>
    >
    > <%objRS.movenext
    > Loop%>
    >
    >
    >
    >
    >
    >
    >
     
    Tom B, Dec 1, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brendan Miller

    Web Forms VS Windows Forms

    Brendan Miller, Aug 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    5,095
    Kevin Spencer
    Aug 11, 2003
  2. Eric
    Replies:
    2
    Views:
    1,496
    Tommy
    Feb 13, 2004
  3. jlopes151
    Replies:
    2
    Views:
    643
    Steve C. Orr [MVP, MCSD]
    Mar 14, 2005
  4. =?Utf-8?B?ZGF2aWQ=?=

    embedded windows forms into web forms for control

    =?Utf-8?B?ZGF2aWQ=?=, Apr 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    5,226
    =?Utf-8?B?ZGF2aWQ=?=
    Apr 10, 2005
  5. Eric
    Replies:
    2
    Views:
    555
Loading...

Share This Page