Skip to main content
Participant
Mar 22, 2012 3:07 AM UTC
Answered

CF forms help please

Hello, first off here is my code.

index.cfm

<html>

<head>

<title>Cold Fusion Form</title>

</head>

<body>

<cfform action="display.cfm" method="post">

<p>

First Name: <cfinput type="Text" name="FirstName" size="20"maxlength="35"><br>

Last Name: <cfinput type="Text" name="LastName" size="20" maxlength="35"><br>

Age:<cfinput type="Text" name="Age" size="10" maxlength="15"><br>

<p>

<!--- Reset button. --->

<cfinput type="Reset" name="ResetForm" value="Clear Form">

<!--- submit button --->

<cfinput type="Submit" name="SubmitForm" value="Submit">

</cfform>

</body>

</html>

display.cfm

<html>

<head>

<title>Cold Fusion Form Homework</title>

</head>

<body>

<cfform action="display.cfm" method="post">

<p>

<cfoutput>First Name: #Form.FirstName#<br>

Last Name: #Form.LastName#<br>

Age: #Form.Age#<br>

<cfset Age = #Form.Age#>

<cfset myAge = Age + 10>

Age +10: #myAge#</cfoutput><br>

<p>

<!--- Reset button. --->

<cfinput type="Reset" name="ResetForm" value="Clear Form">

</cfform>

</body>

</html>

I am very very new to web app development, so I am learning as quickly as possible.

What I am trying to do from this point is have my Clear Form button on the display.cfm return me to the index.cfm with empty forms.

Can any one help please?

Thanks,

Andrew

This topic is closed to new replies. Start a new post to keep the conversation going.
SL1DEmemphisCorrect answer
Participant
Mar 22, 2012 3:22 AM UTC

Never mind.  I figured it out!

<input type="button" name="ClearForm" value="Clear Form" onClick="window.location='index.cfm'">

1 reply

SL1DEmemphisAuthorCorrect answer
Participant
Mar 22, 2012 3:22 AM UTC

Never mind.  I figured it out!

<input type="button" name="ClearForm" value="Clear Form" onClick="window.location='index.cfm'">

Translate