PDA

View Full Version : Diffrent names of values


dealwi8me
05-16-2003, 05:19 PM
I have this source code....

<%
while not (rs2.EOF)
%>
<table width="39%" border="1" dwcopytype="CopyTableRow">
<tr>
<td width="9%"><div align="center"><font color="#660000" face="Times New Roman, Times, serif">
<input name="radiobutton" type="radio" value="radiobutton">
</font></div></td>
<td width="38%"><div align="right"><font color="#660000" face="Times New Roman, Times, serif">&nbsp;
<% Response.Write(rs2("StudId")) %>
</font></div></td>
<td width="53%"><div align="right"><font color="#660000" face="Times New Roman, Times, serif">&nbsp;
<%Response.Write(rs2("Name")) %>
</font></div></td>
</tr>
</table>
<%
rs2.MoveNext
Wend
%>

Is there a way every time it gets in the loop the radiobutton will take a diffrent name? because i want when i post the form according to the radiobutton that is marked to do something diffrent.....

Any suggestions?

Thank you :)

raf
05-16-2003, 08:11 PM
Sure. Use a variable. Something numeric that gets incremented.

dim namenumber
namenumber = 1
while not (rs2.EOF)
%>
<table width="39%" border="1" dwcopytype="CopyTableRow">
<tr>
<td width="9%"><div align="center"><font color="#660000" face="Times New Roman, Times, serif">
<input name="radiobutton<%= namenumber %>" type="radio" value="radiobutton">
</font></div></td>
<td width="38%"><div align="right"><font color="#660000" face="Times New Roman, Times, serif">
<% Response.Write(rs2("StudId")) %>
</font></div></td>
<td width="53%"><div align="right"><font color="#660000" face="Times New Roman, Times, serif">
<%Response.Write(rs2("Name")) %>
</font></div></td>
</tr>
</table>
<%
namenumber = namenumber + 1
rs2.MoveNext
Wend


Also, try to switch as little as possible between asp and html --> has a small sowing down effect on the server

dealwi8me
05-17-2003, 05:46 PM
Yep...! that's what i did and it worked!! Thanks! :)

...and thank you for the tip too...i'll try to do that