what i have is an if statement within a form, which basically means that it displays the value of certain records in a series of field, then you either edit, copy or decline the record which is selected by a radio button. the frm itself posts back to itself, and the value of a field that is changed depending on which button you press to submit the form determines what the script does (ie copy the record, decline it (effectively delete) or open a new part of the program to edit it). The copying and deleting works fine, but when it comes to reloading the page, i want to display the same recordset by default. However, when i come back to the page driectly after having copied or deleted, there is nothing, not even the result of the else (which is designed for when no qualifier has been given by the user by which to select the records)
ok, here's the code for my if statement:
<%
if (pascheck = 14 OR pascheck = 13 OR pascheck = 7) then
fmCL = Request.Form("ClName")
sql = "SELECT PropDate, FarmName, fmPropNo, status FROM BRProp WHERE status='Proposal Not Submitted' AND fmCL='" & fmCL & "'"
vrec.open sql, adoCon
Do WHILE NOT vrec.EOF
%>
<tr>
<td width="15"> </td>
<td width="20"><font face="Arial">
<input type="radio" value="<%Response.Write vrec("fmPropNo")%>" name="radio"></font></td>
<td width="92"><font face="Arial">
<input type="text" name="PropNo_<%Response.Write vrec("fmPropNo")%>" value="<%Response.Write vrec("fmPropNo")%>" size="12" READONLY></a></font></td>
<td width="148"><font face="Arial">
<input type="text" name="notsure_<%Response.Write vrec("fmPropNo")%>" value="<%Response.Write "Broadacre"%>" size="20" READONLY></font></td>
<td width="246"><font face="Arial">
<input type="text" name="FarmName_<%Response.Write vrec("fmPropNo")%>" value="<%Response.Write vrec("FarmName")%>" size="37" READONLY></font></td>
<td width="106"><font face="Arial">
<input type="text" name="PropDate_<%Response.Write vrec("fmPropNo")%>" value="<%Response.Write vrec("PropDate")%>" size="14" READONLY></font></td>
<td width="169"><font face="Arial">
<input type="text" name="status_<%Response.Write vrec("fmPropNo")%>" value="<%Response.Write "Proposal Not Submitted"%>" size="24" READONLY></font></td>
</tr>
<%
vrec.MoveNext
loop
%>
</table>
<div style="position: absolute; width: 100px; height: 38px; z-index: 1; left: 858px; top: 40px" id="cliform2a">
<p align="center">
<button type="submit" value="Edit<BR>Proposal" name="cont1" onMouseDown="window.document.cliform2.cont.value='cliform2Edit'">Edit<BR>
Proposal</button></p>
<p align="center">
<button type="submit" value="Decline" name="cont2" onMouseDown="window.document.cliform2.cont.value='cliform2Decline'">Decline</button></p& amp; gt;
<p align="center">
<button type="submit" value="Copy" name="cont3" onMouseDown="window.document.cliform2.cont.value='cliform2Copy'">Copy</button></div>
<%
else
%>
<tr>
<td width="15"> </td>
<td width="20"><font face="Arial">
<input type="radio" value="" name="radio"></font></td>
<td width="92"><font face="Arial">
<input type="text" name="PropNo" value="" size="12" READONLY></a></font></td>
<td width="148"><font face="Arial">
<input type="text" name="notsure" value="" size="20" READONLY></font></td>
<td width="246"><font face="Arial">
<input type="text" name="FarmName" value="" size="37" READONLY></font></td>
<td width="106"><font face="Arial">
<input type="text" name="PropDate" value="" size="14" READONLY></font></td>
<td width="169"><font face="Arial">
<input type="text" name="status" value="" size="24" READONLY></font></td>
</tr>
</table>
<div style="position: absolute; width: 100px; height: 38px; z-index: 1; left: 858px; top: 40px" id="cliform2a">
<p align="center">
<button value="Edit<BR>Proposal" name="cont1">Edit<BR>
Proposal</button></p>
<p align="center">
<button value="Decline" name="cont2">Decline</button></p>
<p align="center">
<button value="Copy" name="cont3">Copy</button></div>
<%
end if
%>
the pascheck variable is defined earlier in the script (as in before any html) as:
if check = "cliform2Decline" then
pascheck = 13
end if
if check = "cliform2Copy" then
pascheck = 14
end if
where check is a holder for request.form("cont") - the value that the onmousedown changes (and it does because there is other script that runs earlier in the piece if pascheck is 13 or 14. pascheck = 7 is just when you first load that part of the program.
The thing that's getting me is that it works when passcheck = 7, but not when pascheck = 13 or 14... the ifthen to set pascheck is working, but for some reason it seems not to want to recognise pascheck at that point in my code... and don't ask me to post the entire code because there's just under 1400 lines thus far... :p
Edited by ub3rl337ch3ch - 16 March 2005 at 5:47pm