How to use typeahead for autosuggest of Text Box in ColdFusion

CFinput - typeahead for autosuggest in input type text

AutosuggestTypeahead.cfm


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfinput type text: how to use typeahead for autosuggest in input type text</title>
</head>

<body>
<h2 style="color:Crimson; font-style:italic">cfinput type text example: how to use typeahead</h2>
<hr width="500" align="left" color="OrangeRed" />
<br />

<cfif IsDefined("Form.SubmitCountry")>
 <cfoutput>
  <h3 style="color:DeepPink;">
      Your Country is: #Form.Country#
  </h3>
    </cfoutput>
</cfif>

<cfform name="InputTypeTextAutosuggestTest" method="post" format="html">
 <table border="1" cellpadding="5" cellspacing="0" bordercolor="Crimson">
     <tr>
         <td colspan="2" bgcolor="OrangeRed" style="color:Snow; font-size:large" align="center">
             Country Submit Form
            </td>
        </tr>
     <tr height="100" valign="top">
         <td style="color:RosyBrown; font-weight:bold">
             Country Name
            </td>
         <td>
    <cfinput 
                 name="Country" 
                    type="text" 
                    style="background-color:Wheat; color:SaddleBrown; width:250px; height:25px; font-size:large; font-style:italic; font:'Comic Sans MS', cursive"
                    autosuggestminlength="1"
                    autosuggest="Canada; India; Egypt; Brazil; Romania; Italy; Sweden; USA; South Africa; Spain" 
                    delimiter=";"
                    typeahead="yes"
                    >
            </td>
        </tr>
     <tr>
         <td colspan="2" align="right">
       <cfinput 
                 name="SubmitCountry" 
                    type="submit" 
                    value="Submit"
                    style="height:45px; width:150px; font-size:large; font-style:italic; font-weight:bold; color:Crimson;"
                    >
            </td>
        </tr>
    </table>
</cfform>
</body>
</html>





















More ColdFusion examples