Hi All,

On a registration form im pulling a list of countries from mysql.

When i select, say england, i want to populate the provinces of england select option.

Im using a standard loop to do this.

What i dont want to do is force the user to click a button to select their province.

Would a meta refresh do?

I would say, use ajax. Post your code and we can take it from there

Hi ,

Thanks for your response.

In the meantime I have added in a "country selection" part, which then populates the provinces from the passed value.

Ajax is something ive not looked at. Can you suggest any good tutorials to get me started?

Cheers

Paul

Lots of good examples out there:
http://www.w3schools.com/ajax/ajax_intro.asp
http://daniel.lorch.cc/docs/ajax_simple/

Basically you'll have a page that returns the list of provinces based on a passed in parameter. Your main form will have an onChange Javascript event attached to the country selector that calls this page to populate your provinces selector. Try out the examples I linked to and you should get it.

Member Avatar for diafol

IF you're serious about Ajax, learn the basics (objects) so you understand the processes involved and then jump into prototype or jquery. They take the heat out of Ajax - no need to re-invent the wheel a million times.

if it makes the users life easier, with less clicks then i will learn.

thanks all for your help.

regards

paul

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.