Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Passing Form Value 1

Status
Not open for further replies.

d088

Technical User
Jun 27, 2004
9
US
Can someone please tell me why I'm not getting the form value passed to the action page?

Attach Code

<!--SQL.CFM
*****************************************************************--->
<script LANGUAGE="JavaScript">
function confirmSubmit()
{
var agree=confirm("Are you sure you wish to continue?");
if (agree)
return true ;
else
return false ;
}
</script>


<form action="act_SQL.cfm" method="post" name="frmSQL" id="frmSQL">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<p align="center"><span class="blueReg">Enter the SQL code you wish to run in the box below: </span><br>
<textarea name="code" cols="50" rows="10" class="sponsor" id="statement"></textarea>
<br>
<span class="blueBold">CAUTION:</span><span class="blueReg"> This will modify the </span><span class="blueBold">ACTIVE database</span><span class="blueReg"> which controls the entire web site.</span><span class="blueBold"> DO NOT</span><span class="blueReg"> use this feature unless you are </span><span class="blueBold">POSITIVE</span><span class="blueReg"> that you know what you are about to do.</span><br>
<br>
</p>
</td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Run Statement" onClick="confirmSubmit()"></td>
<td><input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>

<p>
<p>

</center>
</body>
</html>





<!---ACT_SQL.CFM
*****************************************************************--->
<cfparam name="frmSQL.code" default = "0">

<cfif frmSQL.code NEQ "0">
<CFOUTPUT>
<P>The follwing SQL code was written to the database:<br> #frmSQL.code#.</P>
</CFOUTPUT>

<cfquery datasource="#dsn#" name="runSQL">
'#frmSQL.statement#'
</cfquery>

<!--- bring to --->
<cflocation url="membership/dsp_MemberList.cfm">
<cfelse>
<cfoutput><p>Sorry the code did not work.</p></cfoutput>
</cfif>
 
Found the answer in the Macromedia Forum:

In ACT_SQL.CFM all references to "frmSQL" should be changed to "form".

For instance:
<cfparam name="frmSQL.code" default = "0">

-should be-

<cfparam name="form.code" default = "0">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top