Skip to main content
May 7, 2008
Question

Form not posting

  • May 7, 2008
  • 7 replies
  • 579 views
The page shows a listing of items from the database. I have four very short (one field) forms that make up the search routine. One lets you search by keyword. It posts to page A. One lets you search by item owner. It posts to page B. Third lets you find all items up for auction. It posts to page C. Fourth clears all searches. It posts to page D. (this seperated answer was a solution to some problem or other that I can't remember now, just know this way fixed it.) All of this works, except that B doesn't post correctly. When you click submit, processing goes to the correct action page, but there are no form vars when you get there. Hence, I get the error "Element xxx is undefined in FORM." When you scroll down and look at the debug info there are the usual Scope Variables, Client Variables, Cookie Variables, even Session Variables, but there are NO form vars. Where did they go?? I am using method=post. I have tried different field names. I have added extra hidden fields with the thought that the server didn't want to pay attention to just one single little field. I have added "onclick='submit this.form'. I changed from input type="image" to "submit". Nothing changes the fact that I get to the action page but the form vars didn't come with me. Anyody got any ideas?

... blah blah blah ...
<!--- ------------------------ Search Forms Start Here ------------------------- --->

<table width="95%" align="center" class="listtext" border="0" Cellspacing="2">
<tr>
<td colspan="3" align="right">
<b>GO!</b><br>
</td>
</tr>

<!-- ------------------- A: Keyword Search ---------------------- -->
<form name="vehiclesearch" action="carlist_searcha.cfm" method="post">
<tr>
<td width="12%" class="listtitle" align="right" valign="top">
A.  
</td>
<td width="*">
Enter a keyword to look for like a manufacturer's
name or a model.   (uses an "AND" search)
</td>
<td width="37%" valign="bottom" align="right" class="listtitle">
Keyword <img src="../images/1x1.gif" width="50" height="5"><br>
<input type="text" name="kword" size="20" >
  <input type="image" src="../images/purparrow.gif" ><br>
</td>
</tr>
</form>
<!-- ------------------- B: Owner Search ------------------------ -->
<CFform name="vehiclesearch" action="carlist_searchb.cfm" method="post">
<tr>
<td class="listtitle" align="right" valign="top">
B.  
</td>
<td>
<b>OR</b> enter an owner's name to find all the vehicles belonging
to a particular person.   
</td>
<td class="listtitle" align="right">
Owner Name <img src="../images/1x1.gif" width="50" height="5"><br>
<CFinput type="text" name="owname" size="20" >
<CFinput type="hidden" name="blank1" value="nothing">
<CFinput type="hidden" name="blank2" value="nadda">
  <input type="image" src="../images/purparrow.gif" onClick="this.form.submit()"><br>
</td>
</tr>
</CFform>
<!-- ------------------ C: Select ebay listings -------------------- -->
<form name="vehiclesearch" action="carlist_searchc.cfm" method="post">
<tr>
<td class="listtitle" align="right" valign="top">
C.  
</td>
<td>
<b>OR</b> check here to show only the vehicles currently listed on ebay.
</td>
<td class="listtitle" align="right">
Ebay <img src="../images/1x1.gif" width="50" height="5"><br>
<input type="checkbox" name="ebay">
<img src="../images/1x1.gif" width="10" height="1">
  <input type="image" src="../images/purparrow.gif" ><br>
</td>
</tr>
</form>

<!-- ----------------- 😧 Clear all searches and sorts ------------ -->
<form name="vehiclesearch" action="carlist_searchd.cfm" method="post">
<tr>
<td class="listtitle" align="right" >
D.  
</td>
<td>
Clear all searches and browse all cars.
</td>
<td align="right">
<input type="hidden" name="clearflag" value="yes">
<input type="submit" value="Clear">
</td>
</tr>
</form>
</table>
<br>

<!--- ------------------------------ End search forms --------------------------- --->

<!-- ------------------------ Column Titles and Sort Links ----------------------- -->
<table align="center" width="98%" border="0" cellpadding="0" cellspacing="0">
... blah blah blah list stuff here ...
    This topic has been closed for replies.

    7 replies

    June 9, 2008
    That pretty much was the entire error message. It always referenced the first line that asked for a form var, no matter what form var I changed it to.

    The error WAS on the action page, but it had nothing to do with the form vars. There was an unidentified regular variable that CF didn't tell me about for some reason. There was also a logic error (supposedly) in a small loop, but I never did really find it. I just retyped the code. It works now. Whatever makes it happy. Off to break more code. Thanks for the help. You pointed me in the right direction.
    Inspiring
    May 8, 2008
    It is on the action page.

    Really need to see the entire error message and the code from the line it references.

    --
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com


    "indnajns" <webforumsuser@macromedia.com> wrote in message news:fvv4sb$bt9$1@forums.macromedia.com...
    > Error is: "Element xxx is undefined in FORM." Doesn't matter which field it
    > comes across first. Error is the same. Debug shows NO form vars being passed,
    > even though clicking submit passes me to the correct action page.
    >
    > CFform was not original code. Only inserted it after getting the error
    > message to see if I could get the server to take me a little more seriously.
    >
    > Getting ready to look into Ken's suggestion that it's somehow the action page.
    >
    May 8, 2008
    Error is: "Element xxx is undefined in FORM." Doesn't matter which field it comes across first. Error is the same. Debug shows NO form vars being passed, even though clicking submit passes me to the correct action page.

    CFform was not original code. Only inserted it after getting the error message to see if I could get the server to take me a little more seriously.

    Getting ready to look into Ken's suggestion that it's somehow the action page.
    Inspiring
    May 8, 2008
    What is the exact error message?

    --
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com


    "indnajns" <webforumsuser@macromedia.com> wrote in message news:fvtjm8$lam$1@forums.macromedia.com...
    > That's exactly the lines I used for checking once I started to get the error.
    > The error moved from like Line 25 --first occurance of form.owname-- to line 2.
    > And it didn't matter which field I put first. It blows up on the first
    > occurance of form.anything.
    >
    > But following your thought, how can it be the action page causing the problem?
    > It's named identically to the other three action pages. It's process follows
    > closely the A page process. I will try pulling the action page apart and
    > putting it back line by line. Now you understand why I'm baffled. (Computers
    > hate me, or couldn't you tell?) :(
    >
    May 8, 2008
    That's exactly the lines I used for checking once I started to get the error. The error moved from like Line 25 --first occurance of form.owname-- to line 2. And it didn't matter which field I put first. It blows up on the first occurance of form.anything.

    But following your thought, how can it be the action page causing the problem? It's named identically to the other three action pages. It's process follows closely the A page process. I will try pulling the action page apart and putting it back line by line. Now you understand why I'm baffled. (Computers hate me, or couldn't you tell?) :(
    Inspiring
    May 8, 2008
    try changing the tag from cfform to simple form - i bet you it will
    submit fine. it is strongly NOT advised to have cfform inside a table.
    having a table inside a cfform is fine, however.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/
    Inspiring
    May 7, 2008
    If I put this on the action page for that form it works fine:

    <cfoutput>
    #FORM.blank1# = blank1<br />
    #FORM.blank2# = blank2<br />
    #FORM.owname# = owname<br />
    </cfoutput>

    That is assuming something was in the owname field.

    --
    Ken Ford
    Adobe Community Expert - Dreamweaver
    Fordwebs, LLC
    http://www.fordwebs.com


    "indnajns" <webforumsuser@macromedia.com> wrote in message news:fvsj9e$hlv$1@forums.macromedia.com...
    > The page shows a listing of items from the database. I have four very short
    > (one field) forms that make up the search routine. One lets you search by
    > keyword. It posts to page A. One lets you search by item owner. It posts to
    > page B. Third lets you find all items up for auction. It posts to page C.
    > Fourth clears all searches. It posts to page D. (this seperated answer was a
    > solution to some problem or other that I can't remember now, just know this way
    > fixed it.) All of this works, except that B doesn't post correctly. When you
    > click submit, processing goes to the correct action page, but there are no form
    > vars when you get there. Hence, I get the error "Element xxx is undefined in
    > FORM." When you scroll down and look at the debug info there are the usual
    > Scope Variables, Client Variables, Cookie Variables, even Session Variables,
    > but there are NO form vars. Where did they go?? I am using method=post. I
    > have tried different field names. I have added extra hidden fields with the
    > thought that the server didn't want to pay attention to just one single little
    > field. I have added "onclick='submit this.form'. I changed from input
    > type="image" to "submit". Nothing changes the fact that I get to the action
    > page but the form vars didn't come with me. Anyody got any ideas?
    >
    > ... blah blah blah ...
    > <!--- ------------------------ Search Forms Start Here
    > ------------------------- --->
    >
    > <table width="95%" align="center" class="listtext" border="0" Cellspacing="2">
    > <tr>
    > <td colspan="3" align="right">
    > GO!<br>
    > </td>
    > </tr>
    >
    > <!-- ------------------- A: Keyword Search ---------------------- -->
    > <form name="vehiclesearch" action="carlist_searcha.cfm" method="post">
    > <tr>
    > <td width="12%" class="listtitle" align="right" valign="top">
    > A.  
    > </td>
    > <td width="*">
    > Enter a keyword to look for like a manufacturer's
    > name or a model.   (uses an "AND" search)
    > </td>
    > <td width="37%" valign="bottom" align="right" class="listtitle">
    > Keyword <img src="../images/1x1.gif" width="50" height="5"><br>
    > <input type="text" name="kword" size="20" >
    >   <input type="image" src="../images/purparrow.gif" ><br>
    > </td>
    > </tr>
    > </form>
    > <!-- ------------------- B: Owner Search ------------------------ -->
    > <CFform name="vehiclesearch" action="carlist_searchb.cfm" method="post">
    > <tr>
    > <td class="listtitle" align="right" valign="top">
    > B.  
    > </td>
    > <td>
    > OR enter an owner's name to find all the vehicles belonging
    > to a particular person.   
    > </td>
    > <td class="listtitle" align="right">
    > Owner Name <img src="../images/1x1.gif" width="50" height="5"><br>
    > <CFinput type="text" name="owname" size="20" >
    > <CFinput type="hidden" name="blank1" value="nothing">
    > <CFinput type="hidden" name="blank2" value="nadda">
    >   <input type="image" src="../images/purparrow.gif"
    > onClick="this.form.submit()"><br>
    > </td>
    > </tr>
    > </CFform>
    > <!-- ------------------ C: Select ebay listings -------------------- -->
    > <form name="vehiclesearch" action="carlist_searchc.cfm" method="post">
    > <tr>
    > <td class="listtitle" align="right" valign="top">
    > C.  
    > </td>
    > <td>
    > OR check here to show only the vehicles currently listed on ebay.
    > </td>
    > <td class="listtitle" align="right">
    > Ebay <img src="../images/1x1.gif" width="50" height="5"><br>
    > <input type="checkbox" name="ebay">
    > <img src="../images/1x1.gif" width="10" height="1">
    >   <input type="image" src="../images/purparrow.gif" ><br>
    > </td>
    > </tr>
    > </form>
    >
    > <!-- ----------------- D: Clear all searches and sorts ------------ -->
    > <form name="vehiclesearch" action="carlist_searchd.cfm" method="post">
    > <tr>
    > <td class="listtitle" align="right" >
    > D.  
    > </td>
    > <td>
    > Clear all searches and browse all cars.
    > </td>
    > <td align="right">
    > <input type="hidden" name="clearflag" value="yes">
    > <input type="submit" value="Clear">
    > </td>
    > </tr>
    > </form>
    > </table>
    > <br>
    >
    > <!--- ------------------------------ End search forms
    > --------------------------- --->
    >
    > <!-- ------------------------ Column Titles and Sort Links
    > ----------------------- -->
    > <table align="center" width="98%" border="0" cellpadding="0" cellspacing="0">
    > ... blah blah blah list stuff here ...
    >