This content has been marked as final. Show 9 replies
I tried that code before I left my post. It doesn't work for me, but maybe let me play with it and see if I did something wrong.
One of the things I don't like about that code is that it doesn't use the output of a query to get the state and country list, which is what I'd prefer.
Any other links or ideas would be much appreciated!!!
The first thing I would do is add as much data to my db as possible. You already have the American states. Add the Canadian provinces and the equivalent records for every other country you are interested in. For countries without states, add a record to that table stating so.
Then you can use related selects, if you know how.
I already have the data in the db...I don't know how to output it using JS.
I also don't know why that JS in the link that Julio gave me doesn't work on a test page. The demo works, but I copy the code in all the right places and it doesn't.
If you already have the data in your db, why are you offering the user a text box? You think they are always going to spell Saskatchewan correctly?
I thought the instructions were just fine. I made the seperate .js file. I put the form on a test page by itself with a link to the js, but no luck yet.
"then use CFOUTPUT to output your own list of countries and states/provinces, using the same format they have for countries and states."
Are you saying I can use a cfoutput in my js file for this list assuming my field values are the same?
If you already have the data in your db, why are you offering the user a text box? You think they are always going to spell Saskatchewan correctly?"
I have a list of all the countries and all the states, but not all the states/provinces in all the countries. For the ones I don't have, I want them to type the value.
I will keep playing with this JS, but I would think that there is another example out there that is better.
I got that script to work...I didn't realize until i tried to paste the code itself into my head tag that I had script tags in the js file...er..uh..oops.
Now I will try to do the cfoutput thing Julio says to try.