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

  • SEARCH
  • Home
  • 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 686251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:00:19+00:00 2026-05-14T02:00:19+00:00

I am using the AJAX Cascading drop down list but want to add event

  • 0

I am using the AJAX Cascading drop down list but want to add event validation e.g. the compare validators.

As the cascading drop down list requires the page event validation to be disabled what is the best way to do the validation?

Thanks

Andy

Validation Attempt:
I have tried to use a custom validator which calls a Javascript function but it doesnt seem to be picking up the control. I get the following error Microsoft JScript runtime error: Object required

function ValidateCostCentCat(source, arguments) 
{
  var countryList = document.getElementById("ddlCategory");
  if (null != countryList) 
  {
    var iValue = countryList.options[countryList.selectedIndex].value;
    if (iValue == "Select Category") 
    {
      arguments.IsValid = true;
    } 
    else 
    {
      arguments.IsValid = false;
    }
  }
}

The mark-up for the custom validator is

<asp:CustomValidator ID="valcustCategory" runat="server" CssClass="error" Display="Dynamic" ValidationGroup="DirectHire" ClientValidationFunction="ValidateCostCentCat"
          ErrorMessage="Please select a Cost Centre Category from the drop down list provided.">!</asp:CustomValidator>
  • 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-14T02:00:20+00:00Added an answer on May 14, 2026 at 2:00 am

    Read This: http://www.w3schools.com/PHP/php_ajax_database.asp

    The example demostrate how to select a
    value from a dropdown box sent it via
    AJAX and get back the responce!

    in the middle you can do all the
    Validation that you want!

    UPDATED with code just for fun! 😉

    Assuming your select is

    <asp:DropDownList ID="CategoryDropDownList" runat="server">
    

    Then you function look like this:

    function ValidateCostCentCat(source, arguments)
    {
        var countryList = document.getElementById("CategoryDropDownList");
        if (null != countryList)
        {
    
        var iValue = countryList.options[countryList.selectedIndex].value;
    
        if ( iValue == "Select Category" ) {
    
        arguments.IsValid = true;
    
        } else {
    
        arguments.IsValid = false;
    
        }
      }
    }
    

    This must work as expected!

    hope this help!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ajax call for to bring the list for my drop down
Im using Ajax to get a value from the Drop down box and display
So I have a cascading dropdown of sorts, but using List Boxes. When an
when i using ajax control but control tick every 1 secound and when i
I am using AJAX modal popup in my project, but there is problem with
I am using Ajax to receive a JSON update: $(document).ready(function(){ $('form').submit(function(event){ event.preventDefault(); var form
Using Ajax.ActionLink's OnSuccess-Event brings me some trouble. As asked here the function cannot be
I am using ajax to update the db with a new folder but it
I submit a form using ajax, and the validation is done on server side.
I am using Ajax in java web application and i want to take the

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.