Using onValidate in CFGRID

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Haitashi
    New Member
    • Jun 2007
    • 96

    Using onValidate in CFGRID

    I have the following grid:
    Code:
    	<cfgrid name="gridChartType"
    		delete="true"
    		deletebutton="Remove"
    		insert="true"
    		insertbutton="Add"
    		width="714"
    		height="500"
    		format="flash"
    		query="variables.qChartType"
    		onValidate="checkValues"
    		selectmode="edit">
    			<cfgridcolumn name="id" display="false" />
    			<cfgridcolumn header="Name" width="500" name="chart" />
    			<cfgridcolumn header="Code" width="214" name="code" />
    	</cfgrid>
    The function called "checkValue s" is a function that exist in a JS file. This file is inclided at the beggining of the file but outside the form.

    However, it doesn't seem to be working. When I add/edit/delete anything in the cgrid, that function doesn't execute. What I need to validate is that the cfgridcolumn called code doesn't exceed 3 characters.

    So, my questions are:
    1. Am I calling the JS function the right way?
    2. Is the way I'm including the JS file correct?
    3. Does anyone have a link to a working example/tutorial of cfgrip that includes validation "how to"?


    Maybe my function isn't written correctly in the JS file (but that would be a Javascript issue and not a CF issue)

    Thanks in advance!!
  • Haitashi
    New Member
    • Jun 2007
    • 96

    #2
    My problem was that I was using the flash cfgrid format and onValidate only works with the applet format.

    Now I gotta figure out if it's possible to validate data while using the flash format =P

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Firstly, check that the JS is correct by changing it to applet. If it works, then you may need to look at an ActionScript solution.

      Comment

      Working...