Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6995665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:03:31+00:00 2026-05-27T20:03:31+00:00

i use this javascript to capture all checkboxes checked in a flexigrid and try

  • 0

i use this javascript to capture all checkboxes checked in a flexigrid and try to send this array of row ids to an CFC

function removeCertidao(){
    var allVals = [];
    $("input[id='certidao']:checked").each(function() {
        allVals.push($(this).val());
    });
    if (allVals.length == 0) {
        alert('É necessário escolher ao menos uma certidão.');
        return false;
    } else {
        alert(allVals);
    }
    $.ajax({
        type: "post",
        url: "../../CFC/CRC.cfc",
        data: {
            method: "removeCertidaoCRC",
            numSeqCertidao: allVals,
        },
        dataType: "json",
        success: function(){
            alert('YES');
        },
        error: function(){
            alert('NO');
        }
    });             
 }

CFC Below

<cffunction access="remote" name="removeCertidaoCRC" returntype="boolean">
    <cfargument name="numSeqCertidao" type="array" required="true">
<cftry>
    <cftransaction>
        <cfquery datasource="portalCompras">
        UPDATE CRC_CERTIDAO CC
           SET CC.ncdcrcstatus = 0
             WHERE CC.NCDCRCCERTIDAO in <cfqueryparam value="#numSeqCertidao#"
                                                          cfsqltype="cf_sql_integer"
                                                          list="yes">
    </cfquery>
        </cftransaction>
    <cftransaction action="commit" />
    <cfreturn 0>
    <cfcatch type="any">
        <cftransaction action="rollback" />
        <cfreturn #cfcatch.message#>
        </cfcatch>
</cftry>
</cffunction>

when i try to run this function, my server answers that The NUMSEQCERTIDAO argument passed to the removeCertidaoCRC function is not of type array.

I’m running out of options on a delayed project in which i entered just recently.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:03:32+00:00Added an answer on May 27, 2026 at 8:03 pm

    jQuery will do a good job of sending the array separated like numSeqCertidao[] = 'val1', numSeqCertidao[] = 'val2' ... but ColdFusion handles this badly and does not take this and rebuild it as an array.

    Your JavaScript is not sending data in JSON format, the dataType option is for the format of the response data. For your needs I would suggest you send numSeqCertidao as a list, give your CFC method’s argument a type of string and leave the rest of it as is, should work fine.

    Slightly amended code:

    function removeCertidao(){
        var allVals = [];
        $("input[id='certidao']:checked").each(function() {
            allVals.push($(this).val());
        });
        if (allVals.length == 0) {
            alert('É necessário escolher ao menos uma certidão.');
            return false;
        } else {
            alert(allVals);
        }
        $.ajax({
            type: "post",
            url: "../../CFC/CRC.cfc",
            data: {
                method: "removeCertidaoCRC",
                numSeqCertidao: allVals.join(),
            },
            dataType: "json",
            success: function(){
                alert('YES');
            },
            error: function(){
                alert('NO');
            }
        });             
     }
    
    <cffunction access="remote" name="removeCertidaoCRC" returntype="boolean">
        <cfargument name="numSeqCertidao" type="string" required="true">
    <cftry>
        <cftransaction>
            <cfquery datasource="portalCompras">
            UPDATE CRC_CERTIDAO CC
               SET CC.ncdcrcstatus = 0
                 WHERE CC.NCDCRCCERTIDAO in <cfqueryparam value="#numSeqCertidao#"
                                                              cfsqltype="cf_sql_integer"
                                                              list="yes">
        </cfquery>
            </cftransaction>
        <cftransaction action="commit" />
        <cfreturn 0>
        <cfcatch type="any">
            <cftransaction action="rollback" />
            <cfreturn #cfcatch.message#>
            </cfcatch>
    </cftry>
    </cffunction>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i use this javascript syntax for validating a checkbox... alert(document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked); if (document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked == false)
I use an externel javascript file and i have this, function getdropdownvalue() { alert($(#<%=DLState.ClientID%>));
In order to put e-mail addresses on my sites, I use this Javascript :
Is it possible to get the value from a JavaScript variable and use this
I already started this in javascript so I don't want to use jquery but
I am trying to get a JavaScript object to use the this assignments of
I am trying to use an HTML form and javascript (i mention this, because
I'd like to use JavaScript to calculate the width of a string. Is this
I see many web analytics application and otherwise use JavaScript to capture data on
I'm trying to find out how I can use javascript to capture the name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.