Skip to main content
Dileep_NR
Inspiring
March 9, 2010
Answered

cfinput required

  • March 9, 2010
  • 1 reply
  • 1340 views

Hi All,

   I have a form using cfinput requred="yes" but the validation is not working in CF9.  So i have submit the form with out filling data in mandatery fileds.

. Also i have noticed the same form working properly in CF8. Is it related with CF9. Please advice

    This topic has been closed for replies.
    Correct answer Adam Cameron.

    Yes, getting error while submitting from

    _CF_hasValue is undefined

    That's symptomatic of not having a /CFIDE mapping on your web server.

    --

    Adam

    1 reply

    Inspiring
    March 9, 2010

    Can you post some code that demonstrates what you're seeing?  Is it one specific form, or is it with any <cfform> you create?  Can you create a very simple <cfform> with appropriate <cfinput>, and do you still see the problem?  Any JavaScript errors?

    As a rule of thumb, if you're asking help with code... it's always good to actually post it, otherwise people can only guess as to what you're doing wrong.

    --

    Adam

    Dileep_NR
    Dileep_NRAuthor
    Inspiring
    March 9, 2010

    index.cfm  page

    <table border="0" cellspacing="0" cellpadding="0">
                    <cfform method="post" action="test.cfm">
                   
                    <tr>
                        <th>Firstname</th>
                        <td ><cfinput class="text-box" type="text" required="Yes" message="Please enter first name" name="name1" size="50" /></td>
                    </tr>
                   
                    <tr>
                        <th>Surname</th>
                        <td ><cfinput class="text-box" type="text" required="Yes" message="Please enter second name" name="name2" size="50" /></td>
                    </tr>
                   
                   
                    <tr>
                        <td> </td>
                        <td colspan="2"><input type="image" src="images/click.gif" name="submit" value="Submit" /></td>
                    </tr>
                    </cfform>
               
                </table>

    Inspiring
    March 9, 2010

    I ran that code on CF9 and the requiredness worked exactly as I would expect.

    As per previous email: are you getting any JS errors?

    --

    Adam