Created
November 18, 2024 14:13
-
-
Save trycf/143ebd2cccbe1661cb1573402ee08ee1 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Input Form --> | |
<form action="processNumber.cfm" method="post"> | |
Enter the number: <input type="text" name="num"> | |
<input type="submit" value="Submit"> | |
</form> | |
<!-- Processing the Input --> | |
<!--<cfif CGI.REQUEST_METHOD EQ 'POST'></cfif>--> | |
<cfif StructKeyExists(form, "num") AND Len(form.num) GT 0> | |
<cfset num = Val(form.num)> <!-- Convert input to numeric --> | |
<cfif num GT 0> | |
<cfoutput>#num# is positive</cfoutput> | |
<cfelseif num LT 0> | |
<cfoutput>#num# is negative</cfoutput> | |
<cfelse> | |
<cfoutput>#num# is zero</cfoutput> | |
</cfif> | |
<cfelse> | |
<cfoutput>Please enter a number above.</cfoutput> | |
</cfif> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment