asp.net, jquery, and web services for 2nd drop down

I have the following codes and need some helps


if inputState is selected then

   using jquery to call webservices and return a array like ('policy1','policy2','policy3')
   fill up the <select> value

else

   leave the <select> alone

------------------------------------------------

<div class="controls">
                                       
<input readonly="true" class="customstyle" type="text" name="inputState" id="inputState"  />
                                        <masteritem  id="states" class="border">
                                            <item data-id="AL">Alabama</item>
                                            <item data-id="AK">Alaska</item>
                                            <item data-id="CA">California</item>
                                            <item data-id="NY">New York</item>
                                            <item data-id="WY">Wyoming</item>                                            
                                        </masteritem>
</div>

<div class="type control-group">
                                   
<label class="control-label" for="inputType">
Policy Type
</label>
                                   
<div class="controls">
                                       
<select id="inputBondType" name="inputBondType">
                                           
<option id="908">Policy1</option>
                                           
<option id="472">Policy2</option>
                                           
<option id="105">Policy3</option>
                                       
</select>
                                   
</div><!-- /.controls -->
                               
</div>
solution1368Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GaryCommented:
Where is your code that is doing the ajax request?
0
solution1368Author Commented:
have not done yet...can you show me how to do it in jquery?
0
solution1368Author Commented:
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

GaryCommented:
It's too late for me now, will get back to it tomorrow if no one else takes it on.
0
Monica PSoftware DeveloperCommented:
This is the sample to load the data with webservice call in AJAX

<script language="javascript" type="text/javascript">
$(document).ready(function() {
$.ajax({
type: "GET",
url: "../WebService.asmx/FindAllCountries",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(response) {
var ddl1 = response.d;
for (var i = 0; i < ddl1.length; i++) {
var selectOption = $(document.createElement(‘option’));
$(‘#ddl1').append(selectOption.val(ddl1[i].CountryID).html(ddl1[i].CountryName)
);
}
},
failure: function(errMsg) {
$(‘#errMessage’).text(errMsg);
}
});
});
</script>

Open in new window



Refer this link for detailed code for the  Dropdown list upload

http://chandradev819.wordpress.com/2011/04/08/how-to-populate-dropdown-on-client-side-using-web-service-and-jquery/
Tutorial for webservice call in ajax
http://mahibislam.wordpress.com/2012/09/03/using-jquery-ajax-json-and-asp-net-web-services/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
solution1368Author Commented:
i need working codes with my codes that I posted.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.