Problem With Button In Table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • brian4cards

    Problem With Button In Table



    I have an html table that is loaded with database records. I have edit
    and delete options inside the table that edit or delete a given row.
    They all work fine except for the very first Edit option (the one that
    corresponds to the first row of data). Can anyone help me out. I have
    provided part of my code below.


    <%
    Do Until rs.EOF
    %>
    <tr>
    <% Dim x, bgcolor
    if x = 1 then
    bgcolor="#E0E0E 0"
    x = 2
    else
    bgcolor="#D0D0D 0"
    x = 1
    end if
    %>
    <td bgcolor = <%=bgcolor%> align="left">
    <table><tr>
    <form method="post" action="edit.as p" name="EditForm" >
    <td>
    <input type="hidden" name="Edit" value= "<%=rs.Fields(0 )%>" >
    <input type="submit" class="modifyLi nk" name="Modify" value="Edit" />|
    </td>
    </form>
    <form method="post" action="admin.a sp" name="DeleteFor m">
    <td>
    <input type="submit" class="modifyLi nk" name="Modify" value="Delete"
    onclick="return confirm('Are you sure you want to delete this
    record?')" />
    <input type="hidden" name="Delete" value= "<%=rs.Fields(6 )%>" >
    </td>
    </form>
    </tr></table>
    </td>
    <td bgcolor = "black"></td>
    <td bgcolor = <%=bgcolor%> name="name"> <%=rs.Fields(1) %>,
    <%=rs.Fields(2) %>
    </td>
    <td bgcolor = "black"></td>
    <td bgcolor = <%=bgcolor%> name="company"> <%=rs.Fields(7) %></td>
    <td bgcolor = "black"></td>
    <td bgcolor = <%=bgcolor%> name="email"> <%=rs.Fields(6) %></td>
    <td bgcolor = "black"></td>
    <td bgcolor = <%=bgcolor%> name="phone"> <%=rs.Fields(4) %></td>
    </tr>
    <%
    rs.MoveNext
    Loop
    %>

  • Harlan Messinger

    #2
    Re: Problem With Button In Table

    The FORM tags all have to go inside the TD tags. Only a TR can contain a
    TD, and a TR can contain only TD or TH.

    brian4cards wrote:[color=blue]
    > http://www.igearonline.com/subscribe/admin.asp
    >
    > I have an html table that is loaded with database records. I have edit
    > and delete options inside the table that edit or delete a given row.
    > They all work fine except for the very first Edit option (the one that
    > corresponds to the first row of data). Can anyone help me out. I have
    > provided part of my code below.
    >
    >
    > <%
    > Do Until rs.EOF
    > %>
    > <tr>
    > <% Dim x, bgcolor
    > if x = 1 then
    > bgcolor="#E0E0E 0"
    > x = 2
    > else
    > bgcolor="#D0D0D 0"
    > x = 1
    > end if
    > %>
    > <td bgcolor = <%=bgcolor%> align="left">
    > <table><tr>
    > <form method="post" action="edit.as p" name="EditForm" >
    > <td>
    > <input type="hidden" name="Edit" value= "<%=rs.Fields(0 )%>" >
    > <input type="submit" class="modifyLi nk" name="Modify" value="Edit" />|
    > </td>
    > </form>
    > <form method="post" action="admin.a sp" name="DeleteFor m">
    > <td>
    > <input type="submit" class="modifyLi nk" name="Modify" value="Delete"
    > onclick="return confirm('Are you sure you want to delete this
    > record?')" />
    > <input type="hidden" name="Delete" value= "<%=rs.Fields(6 )%>" >
    > </td>
    > </form>
    > </tr></table>
    > </td>
    > <td bgcolor = "black"></td>
    > <td bgcolor = <%=bgcolor%> name="name"> <%=rs.Fields(1) %>,
    > <%=rs.Fields(2) %>
    > </td>
    > <td bgcolor = "black"></td>
    > <td bgcolor = <%=bgcolor%> name="company"> <%=rs.Fields(7) %></td>
    > <td bgcolor = "black"></td>
    > <td bgcolor = <%=bgcolor%> name="email"> <%=rs.Fields(6) %></td>
    > <td bgcolor = "black"></td>
    > <td bgcolor = <%=bgcolor%> name="phone"> <%=rs.Fields(4) %></td>
    > </tr>
    > <%
    > rs.MoveNext
    > Loop
    > %>
    >[/color]

    Comment

    • brian4cards

      #3
      Re: Problem With Button In Table

      Everything works except the first edit button. I moved the FORM tags
      inside the TD tags and the same problem still occurs.

      Comment

      • brian4cards

        #4
        Re: Problem With Button In Table

        I figured out a way around it. I submitted the form to the same page
        and then sent it to another page with url parameters.

        Comment

        • brian4cards

          #5
          Re: Problem With Button In Table

          I figured out a way around it. I submitted the form to the same page
          and then sent it to another page with url parameters.

          Comment

          • Harlan Messinger

            #6
            Re: Problem With Button In Table

            brian4cards wrote:[color=blue]
            > Everything works except the first edit button. I moved the FORM tags
            > inside the TD tags and the same problem still occurs.
            >[/color]

            I just looked at it and it's where it was yesterday, with the table
            inside the form.

            Comment

            Working...