home *** CD-ROM | disk | FTP | other *** search
- <!--- This example shows the use of Left --->
-
- <HTML>
-
- <HEAD>
- <TITLE>
- Left Example
- </TITLE>
- </HEAD>
-
- <BASEFONT FACE="Arial, Helvetica" SIZE=2>
- <BODY bgcolor="#FFFFD5">
-
- <H3>Left Example</H3>
-
- <CFIF IsDefined("Form.MyText")>
- <!--- if len is 0, then err --->
- <CFIF Len(form.myText) is not 0>
- <CFIF Len(form.myText) LTE form.RemoveChars>
- <P>Your string <CFOUTPUT>#form.myText#</cFOUTPUT>
- only has <CFOUTPUT>#Len(form.myText)#</cFOUTPUT>
- characters. You cannot output the <CFOUTPUT>#form.removeChars#</cFOUTPUT>
- leftmost characters of this string because it is not long enough
- <CFELSE>
-
- <P>Your original string: <CFOUTPUT>#form.myText#</CFOUTPUT>
- <P>Your changed string, showing only the <CFOUTPUT>#form.removeChars#</CFOUTPUT> leftmost characters:
- <CFOUTPUT>#Left(Form.myText, form.removeChars)#</CFOUTPUT>
-
- </CFIF>
-
-
-
- <CFELSE>
-
- <P>Please enter a string
- </CFIF>
-
-
-
- </CFIF>
-
- <FORM ACTION="left.cfm" METHOD="POST">
- <P>Type in some text
-
- <BR><INPUT TYPE="Text" NAME="MyText">
-
- <P>How many characters from the left do you want to show?
- <SELECT NAME="RemoveChars">
- <OPTION VALUE="1">1
- <OPTION VALUE="3" SELECTED>3
- <OPTION VALUE="5">5
- <OPTION VALUE="7">7
- <OPTION VALUE="9">9</SELECT>
-
- <INPUT TYPE="Submit" NAME="Remove characters">
-
- </FORM>
- </BODY>
- </HTML>
-