Q:

Calling WebMethod via jQuery from JavaScript on ASCX, needing value of Control

I understand how to use jQuery to make an AJAX call to a WebMethod from a normal page, but I'm running into problems doing it from a UserControl (ASCX). Right now the biggest Issue I'm having is that the JavaScript for getting access to the groupDropDown control is not working.  It seems that since this is a UserControl hosted within DotNetNuke, the ususal method of getting the CLientID is not working since it is nested down x number of levels. Here is what I have:
Javascript:
function validateEnrolledDate(src, args) {
    var isValid;
    var groupDropDown = document.getElementById('<%= ddlDealer.ClientID %>');

    $.ajax({
        type: "POST",
        url: "ajaxservice.asmx/ValidateEnrolledDate",
        data: "{orderDate: '" + args.Value + "', groupId: '" + groupId + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        async: false,
        success: function (msg) {
            alert(msg);
            isValid = msg.d;
        },
        failure: function () {
            alert("FAIL");
        }
    });
    args.IsValid = isValid;

Validator User Control that calls this JavaScript:
<asp:CustomValidator id="CustomValidator1" runat="server" ControlToValidate="rdiDate" ErrorMessage="Fail" OnServerValidate="CustomValidator1_ServerValidate" ValidationGroup="vgce" CssClass="validation" Display="Dynamic" Text="*" ClientValidationFunction="validateEnrolledDate" />

groupDropDown I'm trying to get a value from:
<asp:DropDownList ID="ddlDealer" runat="server" CssClass="dropdownlist theDealer" TabIndex="3" AutoPostBack="true" OnSelectedIndexChanged="ddlDealers_Changed" />

WebMethod:
[WebMethod()]
    private bool ValidateEnrolledDate(string orderDate, string groupId)
    {
        DateTime enrolledDate = new Service().GetEnrollmentDate(int.Parse(groupId));

        if (DateTime.Parse(orderDate) >= enrolledDate)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

TIME TO SIMPLIFY:
Here is testing JS Code:
function validateEnrolledDate(src, args) {
    var isValid;
    var selectedGroup = $("theDealer").val();

    alert(selectedGroup);
}

I'm now just referencing a TextBox:
<asp:TextBox ID="dealerId" runat="server" CssClass="theDealer" />

The Text in the Textbox is being set in Server Side code, and it is visible on screen.
The alert message is "undefined", so something is still happening so that it is not getting the value of that textbox...

A:

If you are having trouble getting the value of the drop down list the easist approach would be to assign a class to the control.
<asp:DropDownList ID="ddlUsers" runat="server" CssClass="dropdownlist theUsers" TabIndex="5" AutoPostBack="true" OnSelectedIndexChanged="ddlUsers_SelectedIndexChanged" Enabled="false" />

and than in your method.
var selectedUser = $("theUsers option:selected").val();

