Newbie Forms

T

TNGgroup

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%>
 
J

Jeff Cochran

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
 
T

Tom B

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top