Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CF forms help please

New Here ,
Mar 21, 2012 Mar 21, 2012

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

521
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

New Here , Mar 21, 2012 Mar 21, 2012

Never mind.  I figured it out!

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

Translate
New Here ,
Mar 21, 2012 Mar 21, 2012
LATEST

Never mind.  I figured it out!

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources