web page not returning values

Topics: Developer Forum, Project Management Forum, User Forum
Jan 27, 2011 at 4:35 PM

I create a web form containing 62 fields but when i click submit, it does not return the values entered on the screen. Is there a limit to the number of fields a web form should have? For ease of design I used the SHARE POINT DESIGNER 2007  to design the form but included the necessary ACTIVEVFP calls. I bypassed the call to verify.htm but called thanks.htm. What could be the cause? 

Coordinator
Jan 27, 2011 at 5:07 PM

well it would help if we saw your code

Jan 27, 2011 at 6:51 PM
Good day Claud. Please find attached my MAIN.PRG, DETAIL.HTM and MYORDER.DBF. Thanks for help.


From: [email removed]
To: [email removed]
Date: Thu, 27 Jan 2011 09:07:19 -0800
Subject: Re: web page not returning values [activevfp:243549]

From: claudefox
well it would help if we saw your code
Read the full discussion online.
To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)
To start a new discussion for this project, email activevfp@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Jan 27, 2011 at 8:03 PM

I didn't get the attachment.  If you just paste the text of your routine from main.prg here, that will work.  Specifically where you retrieve the variables from the html form..

Jan 27, 2011 at 11:48 PM

FUNCTION RecordDetail
LOCAL lcHTMLfile,lcHTMLout,lcCustID
lcCustID= oRequest.querystring("order_no")
IF .NOT. USED('myorder')
    USE ('myorder') IN 0 SHARED
ENDIF
SELECT myorder
SET ORDER TO order_no
*SEEK PADR(lcCustID,LEN(myorder.order_no),' ')
*IF .NOT. EOF()
    ***oSession values will populate HTML template
    oSession.VALUE("order_no",ALLTRIM(myorder.order_no))
    oSession.VALUE("cust_id","")  && ALLTRIM(myorder.cust_id))
    oSession.VALUE("Placer","")  && ALLTRIM(myorder.placer))
    for i = 1 to 15
       mnet = "network"+STR(i,IIF(i<10,1,2))
       MDENOM = "denom"+STR(i,IIF(i<10,1,2))
       mquantity = "quantity"+STR(i,IIF(i<10,1,2))
       mlocation = "location"+STR(i,IIF(i<10,1,2))
       oSession.VALUE(mnet,"")  && ALLTRIM(myorder.network))
       oSession.VALUE(mdenom,"") && ALLTRIM(STR(myorder.denominat,5,0)))
       oSession.VALUE(mquantity,"") && ALLTRIM(STR(myorder.quantity,10,2)))
       oSession.VALUE(mlocation,"") && myorder.location)
    endfor
    lcHTMLfile = 'detail.htm'
    lcHTMLout=FILETOSTR(oProp.HtmlPath+lcHTMLfile)
    lcHTMLout= oHTML.mergetext(lcHTMLout)
*ELSE
*    lcHTMLout= 'Not Found!'
*ENDIF
RETURN lcHTMLout
ENDFUNC

 

FUNCTION thanks
LOCAL lcHTMLfile,lcHTMLout
MORDER = TTOC(DATETIME(),1)
FOR i = 1 TO 15
    mnet = "network"+STR(i,IIF(i<10,1,2))
    MDENOM = "denom"+STR(i,IIF(i<10,1,2))
    mquantity = "quantity"+STR(i,IIF(i<10,1,2))
    mlocation = "location"+STR(i,IIF(i<10,1,2))
   IF EMPTY(oSession.VALUE(MNET))
     EXIT
   ELSE
       INSERT INTO myorder (ORDER_NO,cust_id,placer,network,denominat,quantity,location);
       VALUES (MORDER,oSession.VALUE("cust_id"),oSession.VALUE("placer"),oSession.VALUE(mnet),VAL(oSession.VALUE(mdenom)),VAL(oSession.VALUE(mquantity)),oSession.VALUE(mlocation))
   ENDIF
ENDFOR
RETURN
lcHTMLfile = 'thanks.htm'
lcHTMLout=FILETOSTR(oProp.HtmlPath+lcHTMLfile)
lcHTMLout= oHTML.mergetext(lcHTMLout)
RETURN lcHTMLout
ENDFUNC

Please I will resend the detail.htm I suspect that is where the error could come from.

Jan 28, 2011 at 12:25 AM
here is the detail.htm in zip format


From: [email removed]
To: [email removed]
Date: Thu, 27 Jan 2011 12:03:49 -0800
Subject: Re: web page not returning values [activevfp:243549]

From: claudefox
I didn't get the attachment. If you just paste the text of your routine from main.prg here, that will work. Specifically where you retrieve the variables from the html form..
Read the full discussion online.
To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)
To start a new discussion for this project, email activevfp@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com
Coordinator
Jan 28, 2011 at 6:18 AM
Edited Jan 28, 2011 at 6:19 AM

I didn't get the zip, but, to cut to the chase,  Here's the key code to get the entered form values from your html:

oRequest.FORM("title")
oRequest.FORM("address")

You can update your vfp table directly with these values or put them into a session variable to verify them first as I did in the demo.

"Title" and "address" are the form fields in your HTML which would look something like this (they need to be within <Form> </Form>:

 

<form action="<%=oProp.ScriptPath+[?action=thanks]%>" method="post" name="theForm" onsubmit="return Form1_Validator(this)">
        <font face="Arial">
        <p><b>Enter customer information <font color="#ff0000">(items in red are
        required)</font>:</b>
        <p>&nbsp;
        <table border="0" cellPadding="0" cellSpacing="0" width="500">
          <input name="CustomerID" type="hidden" value="0"><input name="CustType" type="hidden" value="PC">
          <tbody>
            <tr>
              <td width="40%"><font face="Arial"><small>Company Name:</small></font></td>
              <td width="60%"><font face="Arial"><small>
              <input name="Company" size="35" value=""></small></font></td>
            </tr>
            <tr>
              <td><small><font color="#ff0000" face="Arial">Contact Name:</font></small></td>
              <td><small>
              <input name="Contact" size="35" value=""></small></td>
            </tr>
            <tr>
              <td><small><font color="#ff0000" face="Arial">Mailing Address 1:</font></small></td>
              <td><font face="Arial"><small>
              <input name="Address" size="35" value=""></small></font></td>
            </tr>
            <tr>
              <td><font face="Arial"><small>Title:</small></font></td>
              <td><font face="Arial"><small>
              <input name="Title" size="35" value=""></small></font></td>
            </tr>
            <tr>
              <td><small><font color="#ff0000" face="Arial">City:</font></small></td>
              <td><font face="Arial"><small>
              <input name="City" size="35" value="">&nbsp;&nbsp;</small></font></td>
            </tr>
            <tr>
              <td><font face="Arial"><small><font color="#ff0000" face="Arial">State
                (US/Can), Zip/Postal</font></small></font></td>
              <td><font face="Arial"><small><small><select name="region">
                  <%=cStates%>
                </select><input name="postalcode" size="10" value=""></small></small></font></td>
            </tr>
            <tr>
              <td><font face="Arial" color="#FF0000"><small>Country:</small></font></td>
              <td><font face="Arial"><small><select NAME="Country" SIZE="1">
                  <%=cCountries%>
                </select></small></font></font></small></font></td>
        </tr>
        <small>
        <tr>
          <td><small><font color="#000000" face="Arial">Voice Phone:</font></small></td>
          <td><small>
          <input name="Voice" size="15" value=""></small></td>
        </tr>
        <tr>
          <td><font face="Arial"><small>FAX:</small></font></td>
          <td><small>
          <input name="FAX" size="15" value=""></small></td>
        </tr>
        <tr>
          <td><font color="#ff0000" face="Arial"><small>E-Mail Address:</small></font></td>
          <td><font face="Arial"><small>
          <input name="EMail" size="35" value=""></small></font></td>
        </tr>
        </tbody>
      </table>
      <p align="center"><input name="B1" type="submit" value="Submit"> </small></font><small><font face><input type="reset" value="Reset" name="B2"></font></small><font face><small>
      <font face="arial,helvetica"><input type="button" value="Go Back" onClick="history.back()"></font></small></font></p>
      </form>

 

Jan 28, 2011 at 8:46 AM
A very good morning to you Claud. THe oRequest.Form clause worked perfectly. I am very grateful to you.


From: [email removed]
To: [email removed]
Date: Thu, 27 Jan 2011 22:18:59 -0800
Subject: Re: web page not returning values [activevfp:243549]

From: claudefox
I didn't get the zip, but, to cut to the chase, Here's the key code to get the entered form vales from your html:
oRequest.FORM("title")
oRequest.FORM("address")
You can update your vfp table directly with these values or put them into a session variable to verify them first as I did in the demo.
"Title" and "address" are the form fields in your HTML which would look something like this (they need to be within <Form> </Form>:

<form action="<%=oProp.ScriptPath+[?action=thanks]%>" method="post" name="theForm" onsubmit="return Form1_Validator(this)">
<font face="Arial">
<p><b>Enter customer information <font color="#ff0000">(items in red are
required)</font>:</b>
<p>
<table border="0" cellPadding="0" cellSpacing="0" width="500">
<input name="CustomerID" type="hidden" value="0"><input name="CustType" type="hidden" value="PC">
<tbody>
<tr>
<td width="40%"><font face="Arial"><small>Company Name:</small></font></td>
<td width="60%"><font face="Arial"><small>
<input name="Company" size="35" value=""></small></font></td>
</tr>
<tr>
<td><small><font color="#ff0000" face="Arial">Contact Name:</font></small></td>
<td><small>
<input name="Contact" size="35" value=""></small></td>
</tr>
<tr>
<td><small><font color="#ff0000" face="Arial">Mailing Address 1:</font></small></td>
<td><font face="Arial"><small>
<input name="Address" size="35" value=""></small></font></td>
</tr>
<tr>
<td><font face="Arial"><small>Title:</small></font></td>
<td><font face="Arial"><small>
<input name="Title" size="35" value=""></small></font></td>
</tr>
<tr>
<td><small><font color="#ff0000" face="Arial">City:</font></small></td>
<td><font face="Arial"><small>
<input name="City" size="35" value=""> </small></font></td>
</tr>
<tr>
<td><font face="Arial"><small><font color="#ff0000" face="Arial">State
(US/Can), Zip/Postal</font></small></font></td>
<td><font face="Arial"><small><small><select name="region">
<%=cStates%>
</select><input name="postalcode" size="10" value=""></small></small></font></td>
</tr>
<tr>
<td><font face="Arial" color="#FF0000"><small>Country:</small></font></td>
<td><font face="Arial"><small><select NAME="Country" SIZE="1">
<%=cCountries%>
</select></small></font></font></small></font></td>
</tr>
<small>
<tr>
<td><small><font color="#000000" face="Arial">Voice Phone:</font></small></td>
<td><small>
<input name="Voice" size="15" value=""></small></td>
</tr>
<tr>
<td><font face="Arial"><small>FAX:</small></font></td>
<td><small>
<input name="FAX" size="15" value=""></small></td>
</tr>
<tr>
<td><font color="#ff0000" face="Arial"><small>E-Mail Address:</small></font></td>
<td><font face="Arial"><small>
<input name="EMail" size="35" value=""></small></font></td>
</tr>
</tbody>
</table>
<p align="center"><input name="B1" type="submit" value="Submit"> </small></font><small><font face><input type="reset" value="Reset" name="B2"></font></small><font face><small>
<font face="arial,helvetica"><input type="button" value="Go Back" onClick="history.back()"></font></small></font></p>
</form>

Read the full discussion online.
To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)
To start a new discussion for this project, email activevfp@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com