Results 1 to 3 of 3

Thread: ColdFusion form error

  1. #1

    ColdFusion form error

    I'm a coldfusion newb and am trying to build my first form with it. From what I understand, when you use conditional logic with CF, the else statements are nested inside the if statements. Nevertheless, I'm trying to process my form using the following code. It keeps telling me that I'm missing an ending if tag, but it's in there. If anyone has any ideas as to why this isn't working, I'd appreciate it. Thanks!

    Jesse

    Code:
    <cfif IsDefined("FORM.submit")>
    <cfoutput>
    #FORM.fName# <br />
    #FORM.lName# <br />
    #FORM.company# <br />
    #FORM.email# <br />
    #FORM.phone# <br />
    #FORM.zip# <br />
    #FORM.country# <br />
    #FORM.state# <br />
    #FORM.employees#
    </cfoutput>
    
    <cfelse>
    <cfoutput>
    <h2>Get More Info</h2>
    <p>*Required</p>
    <form action="#CGI.SCRIPT_NAME#" method="post">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td>
    <label for="fName">*First Name:</label></td>
    <td>
    <input type="text" name="fName" /></td>
    </tr>
    <tr>
    <td>
    <label for="lName">*Last Name:</label></td>
    <td>
    <input type="text" name="lName" /></td>
    </tr>
    <tr>
    <td>
    <label for="company">*Company:</label></td>
    <td>
    <input type="text" name="company" /></td>
    </tr>
    <tr>
    <td>
    <label for="email">*Email:</label></td>
    <td>
    <input type="text" name="email" /></td>
    </tr>
    <tr>
    <td>
    <label for="phone">*Phone:</label></td>
    <td>
    <input type="text" name="phone" /></td>
    </tr>
    <tr>
    <td>
    <label for="zip">*Postal Code:</label></td>
    <td>
    <input type="text" name="zip" /></td>
    </tr>
    <tr>
    <td>
    <label for="country">*Country:</label></td>
    <td>
    <input type="text" name="country" /></td>
    </tr>
    <tr>
    <td>
    <label for="state">*US State/Canadian Province:</label></td>
    <td>
    <input type="text" name="state" /></td>
    </tr>
    <tr>
    <td>
    <label for="employees">*Number of employees:</label></td>
    <td>
    <input type="text" name="employees" /></td>
    </tr>
    <tr>
    <td colspan="2" align="right" valign="top">
    <input type="submit" value="SEND" name="submit" />
    </td>
    </tr>
    </table>
    </form>
    </cfoutput>
    </cfelse>
    </cfif>

  2. #2
    don't close the cfelse

  3. #3
    Awesome. Thanks senocular.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012