Monday, September 29, 2008

[jQuery] Re: autopopulate select drop down using jquery and json and parse json data based on selection

Morning

Absolutely Great!

In the example that you gave,

How does assign the selected item

Example:

If I select a country in the menu

It should display,

Selected Country :

Country Code:

Also

var CountryCode = { "Belgium": 103, "China": 106 };

Is this json?

Can we call it as an external country.js file as my data set is large.

Your explanation should help everyone visiting the thread.

Thanks a lot, this is lean and meets my need compared to jquery select
box manipulation plugin.

Thanks


</body>
</html>

On Sep 29, 9:26 am, MorningZ <morni...@gmail.com> wrote:
> Like this:
>
> http://paste.pocoo.org/show/86509/
>
> On Sep 28, 10:54 pm, prakash123 <prakash...@gmail.com> wrote:
>
>
>
> > Hello
>
> > I need your help on this.
>
> > Example:
> > I have JSON data
>
> > Country Code
>
> > Belgium 106
> > China 103
>
> > How do I populate a HTML select dropdown box with the json data
>
> > Select Dropdown(Belgium, China)
>
> > Now when I select a value like China, it should traverse JSON and
> > display the code.
>
> > Can someone show me an example of how, this can be done using JSON and
> > Jquery.
>
> > Thanks

No comments: