Sent by carl lofton on 03/11/2003 01:02:32 PM:
I've got a program that has 3 procedures a main procedure, a display and a save procedure. I can't seem to figure out how to pass the value (reference number) selected from my main procedure into the other 2 procedures.
here's my program:
m.lmode =PROPER(Request.item("mode"))
m.lgRefno = (Request.item("refno")) //this is empty
DO CASE
CASE m.lMode = "Mainform"
DO MainForm
CASE m.lMode = "Savedata"
DO SaveData with m.lgrefno
CASE m.lMode = "Survey"
DO pSurvey WITH m.lgRefno
ENDCASE
PROCEDURE Mainform
%>
<BODY BGCOLOR=Turquoise>
<CENTER>
</HEAD>
<script>
function submitVal(varin) {
if (varin=="Survey") {
document.survey.mode.value = varin
document.survey.submit()
}
}
</SCRIPT>
<%
SELECT ;
RefNo,;
bd_Name,;
bd_address,;
Complete ;
FROM (m.gDataPath+"PASSRV") ;
INTO CURSOR Temp ;
WHERE CasCode = m.gCasCode ;
ORDER BY BD_name
m.lSrvRec = _TALLY
%>
<P>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=6 WIDTH=500>
<TR ALIGN=LEFT>
<TD COLSPAN=2>
Please complete the survey form for each of the buildings listed below as
per the march "DATE" memorandum to all Court Unit Executives</A>.
<TR>
<TD ALIGN=CENTER>
<%
IF m.lSrvRec > 0
%>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD>
<SELECT SIZE=10 NAME='refno'>
<%
SCAN
Response.write("<OPTION VALUE="+RefNo+IIF(RECNO()=1," SELECTED","")+">"+TRIM(BD_Name)+" "+IIF(EMPTY(Complete),"(incomplete)","(completed)")+"</OPTION>"+CHR(13))
ENDSCAN
%>
</SELECT>
</TR>
</TABLE>
<P>
<INPUT TYPE=button VALUE="Select" onClick=submitVal("Survey")>
<%
ENDIF
%>
</TD>
<%m.gRefNo = Request.form("refno")%> ///??????
</TR>
<TR>
<TD>
Click here for <A HREF=/passrvhelp.htm#assistance>assistance and contact info</A>.
</TD>
</TR>
</TABLE>
<FORM name=survey action=/passrv.fwx method=POST>
<INPUT TYPE=hidden NAME=mode value="Survey">
<INPUT TYPE=hidden NAME=refno value=<%m.gRefno%>
<P>
<HR>
</form></body></html>
<%RETURN%>
<%PROCEDURE SaveData
m.gRefNo = Request.item("refno")
DO Survey WITH ;
"PASSRV",;
"OXGIMSX",;
m.gRefNo,;
.T.
Response.Write("</FORM></body></html>")
RETURN
%>
<% PROCEDURE pSurvey
PARAMETERS refno
m.gRefNo = Request.item("refno")
WAIT WINDOW "IN SURVEY PROCEDURE"
WAIT WINDOW m.gcascode + "" + m.grefno %>
<BODY BGCOLOR=Turquoise>
<FORM action=/passrv.fwx method="post">
<INPUT TYPE=hidden NAME=mode value="Savedata">
<% WAIT WINDOW m.gRefNo
DO Survey WITH ;
"PASSRV",;
"OXGIMSX",;
m.gRefNo,;
.F.
RETURN
%>