Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
friends i want to populate drop down using web service from javascript.My web method have multiple parameters so i need to pass multiple values..
actually Here I am trying to set the permanent address same as correspondence address....
My java script code is
JavaScript
function CopyAddress()
{
    var chk = document.getElementById("<%= chkSameAsCorres.ClientID %>");
    
    if (chk.checked)
    {
        document.getElementById("<%= txtPHouseNo.ClientID %>").value = 
            document.getElementById("<%= txtCHouseNo.ClientID %>").value;
        document.getElementById("<%= txtPBuildingName.ClientID %>").value =
            document.getElementById("<%= txtCBuildingName.ClientID %>").value;
        document.getElementById("<%= txtPStreet.ClientID %>").value = 
            document.getElementById("<%= txtCStreetName.ClientID %>").value;
       document.getElementById("<%=ddlPState.ClientID %>").value=
                    document.getElementById("<%=ddlCState.ClientID %>").value;
        var ddlpid= document.getElementById("<%=ddlCState.ClientID %>");
        var obj={"knownCategoryValues":"States:"+ddlpid.value+"","Category":"DistrictID"};
        function filldropdown(result)
        {
       alert(result);
        };
        try{
          CasCadingDropDown.GetDistricts(obj,filldropdown);
        }
        catch(e){
        alert(e);
        }
}
}

Web Service code is
C#
public CascadingDropDownNameValue[] GetDistricts(string knownCategoryValues, string category)
{
// (irrelevant except for signature)
}
Posted
Updated 15-Nov-15 23:56pm
v5
Comments
[no name] 16-Nov-15 5:09am    
Please tag what the technologies you are using like ASP.NET, PHP, C#, JAVA etc. to answer it better. Secondly are you sending AJAX request to WebService. Moreover you can provide part of your relevant code.
F-ES Sitecore 16-Nov-15 5:10am    
What have you tried so far? Have you even googled for "call webservice javascript multiple parameters" and seen sample code?
Sinisa Hajnal 16-Nov-15 5:57am    
What have you tried? There is no ajax call in your javascript code...
Where is the issue?
User-11630313 16-Nov-15 6:06am    
the problem is i did not get data from web service..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900