topher793
08-06-2008, 05:12 PM
I am relatvily new to to asp/vbscript development, i am trying to record the value of a select form an put in into an array value, i have tried by including code like the following onChange="<%change = 1 %> or with the onSubmit, and with the OnClick variety. and later i simply have an if statement that says change = 1. but what happens is the code within the if statement is executed automatically, so it is executing my code onChange="<%change = 1 %> without the click/submit/change trigger. i am not sure what else to try. Thanks for the help
I have pasted my code bellow:
<%
response.Write(cat) %></b></font></td> </tr> <%
newcat = 0
end if
%>
<tr align="center">
<td width="25%" ><a class="thumbnail" href="#thumb"><%=rs("formnum")%><span><img src=<%response.Write(thepic)%> border="0" /></span></a></td>
<td width="25%"><%=rs("Description")%></td>
<td width="25%"><%=rs("Packs Of")%></td>
<td width="25%" valign="middle"><form name="qty<%response.Write(count)%>" action="" >
<select name="qty<%response.Write(count)%>" onChange="<%change = 1 %>">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</form></td>
</tr>
<%
rs.movenext
end if
count = count + 1 ' gives all qty boxes unique names
loop
else
response.Write("<tr align=""center""><td colspan=""8"">There are currently no forms available to order.</td></tr>")
end if
<%
if change = 1 then
response.Write("WORKED")
response.Redirect("google.com")
do while count =>0
response.Write(request.Form("qty"&count))
response.Write("TEST")
count = count -1
loop
end if
%>
I have pasted my code bellow:
<%
response.Write(cat) %></b></font></td> </tr> <%
newcat = 0
end if
%>
<tr align="center">
<td width="25%" ><a class="thumbnail" href="#thumb"><%=rs("formnum")%><span><img src=<%response.Write(thepic)%> border="0" /></span></a></td>
<td width="25%"><%=rs("Description")%></td>
<td width="25%"><%=rs("Packs Of")%></td>
<td width="25%" valign="middle"><form name="qty<%response.Write(count)%>" action="" >
<select name="qty<%response.Write(count)%>" onChange="<%change = 1 %>">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</form></td>
</tr>
<%
rs.movenext
end if
count = count + 1 ' gives all qty boxes unique names
loop
else
response.Write("<tr align=""center""><td colspan=""8"">There are currently no forms available to order.</td></tr>")
end if
<%
if change = 1 then
response.Write("WORKED")
response.Redirect("google.com")
do while count =>0
response.Write(request.Form("qty"&count))
response.Write("TEST")
count = count -1
loop
end if
%>