Skip to main content
Inspiring
December 14, 2012
Answered

bind: Bind failed, element not found: specGroupID and specCategoryID

  • December 14, 2012
  • 1 reply
  • 5093 views

I'm trying to get a form with three connected <cfselect> statements. The code works in all browsers except IE. Does anyone have any suggestions.

When it runs in IE I get the following error.

bind: Bind failed, element not found: specGroupID

bind: Bind failed, element not found: specCategoryID

CFSELECT Code:

<cfform name="specCategories" id="specCategories">

     <ol>

          <li>

            <label for="categoryID">Category</label>

               <cfselect

                    name="categoryID"

                    id="specCategoryID"

                    bind="cfc:specifications.getCategory()"

                    bindonload="true"

                    style="width: 185px;">

                    <option value="0">All Categories</option>

               </cfselect>

          </li>

          <li>

            <label for="specGroupID">Group</label>

               <cfselect

                    name="groupID"

                    id="specGroupID"

                    bind="cfc:specifications.getGroup({specCategories:specCategoryID.value})"

                    bindonload="false"

                    style="width: 185px;">

                    <option value="0">All Groups</option>

               </cfselect>

          </li> 

          <li>

               <label for="specTypeID">Type</label>

                    <cfselect

                         name="typeID"

                         id="specTypeID"

                         bind="cfc:specifications.getType({specCategories:specCategoryID.value},{specCategories:specGroupID.value})"

                         bindonload="false"

                         style="width: 185px;">

                         <option value="0">All Types</option>

                    </cfselect>

               </li>

          </ol>

</cfform>

This topic has been closed for replies.
Correct answer r_stead

Don't leave us in limbo. Please let us know whether the problem has been solved. If so, kindly share your solution with the forum.  


This is resolved.

It seems the main cause of the problem was a <p> tag I had wrapping the form. Once this was removed it reveiled an issue in the function which was corrected as shown below.

<cfif not isNumeric(arguments.groupID) or arguments.groupID eq "">

     <cfset arguments.groupID = 0>

</cfif>

1 reply

BKBK
Community Expert
Community Expert
December 15, 2012

{specCategories:specCategoryID.value}, {specCategories:specGroupID.value}

Shouldn't those be based on just the field names, {categoryID} and {groupID}, respectively?

r_steadAuthor
Inspiring
December 17, 2012

I actually started there and after getting the same error began to be more specific in my declaration of the variable. As I said is works in all browsers except IE — even using the variation you mentioned.

BKBK
Community Expert
Community Expert
December 17, 2012

Odd. I wouldn't know what the matter is. I can only guess.

What if you you leave out bindonload="false" (which is unnecessary anyway). Also, replace the extra

<option value="0">...</option> tags by slightly modifying the respective arrays returned by the methods getCategory, getGroup and getType, according to the following example:

Within getCategory():

<cfset arr[1][1]="0">

<cfset arr[1][2]="All Categories">

<!--- Use your own names for the query and columns --->

<cfloop query="getCategories">

<cfset arr[currentrow+1][1]=catId>

<cfset arr[currentrow+1][2]=catName>

</cfloop