Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit button

Status
Not open for further replies.

baza

Programmer
May 15, 2001
20
ES
please help, I have an asp page with a list box and 2 buttons on it when i click the first button the selected value from the listbox is passed to the relevant page, but when i click the second button it does not pass the selected value.

Here is the code


<tr class=&quot;Body1&quot;>
<td>
<div align=&quot;center&quot;>
<% If Not rstUserList.EOF Then %>
<form method=&quot;POST&quot;action=&quot;viewmachines1.asp&quot;>
<select name=&quot;usersid&quot; size=&quot;5&quot;>
<% Do While Not rstUserList.EOF
If intcounter = 1 Then
Response.Write(&quot;<option value=&quot;&quot;&quot; & rstUserList(&quot;sid&quot;) & &quot;&quot;&quot; selected>&quot;)
intCounter = intCounter + 1
Else
Response.Write(&quot;<option value=&quot;&quot;&quot; & rstUserList(&quot;sid&quot;) & &quot;&quot;&quot;>&quot;)
End If
%>
<% = rstUserList(&quot;uid&quot;) %> (<% = rstUserList(&quot;fname&quot;) %>)
</option>
<%
rstUserList.MoveNext
Loop
%>
</select>
<p><input type=&quot;submit&quot; value=&quot;<%=lang(cnnDB, &quot;EditUserMachine&quot;)%>&quot;></p>
</form>
<% End If %>

<form name=&quot;addmachine&quot; method=&quot;POST&quot; action=&quot;addmachine.asp&quot;>
<p><input type=&quot;submit&quot; value=&quot;<%=lang(cnnDB, &quot;AddNewMachine&quot;)%>&quot;></p>
</div>
</td>
</tr>

 
Hi Baza

I believe that one one form can be used on each page. Better to combine the forms and write code to get the required results on the submission page.

hth
Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top