Hi,
I have been trying to find an example of a form liek that on autotrader http://www.autotrader.co.uk/. Basically say you pick a car make as BMW, then the next field will only populate BMW models. So once you've selected input 1, input 2 is filtered for you. I must not be searching for it very well in Google as I can't find any examples. I'd just like to see how it's done.
Does anyone have any good links?
Thanks
javascript forms
Re: javascript forms
You need to make an AJAX request, to get all of the makes of car based on the selection. Then use this to populate the second box.
So using the cars example you would probably make a request to something.php?make=BMW where BMW would come from the selection. something.php would output a JSON encoded array which you would decode and use to fill in the next box.
Try searching for "javascript auto populate select" or something similar.
So using the cars example you would probably make a request to something.php?make=BMW where BMW would come from the selection. something.php would output a JSON encoded array which you would decode and use to fill in the next box.
Try searching for "javascript auto populate select" or something similar.
Re: javascript forms
Thanks Jacek,
Found a couple of examples. I knew what technologies were used and roughly how do it, but my searching was pretty bad. thanks
Found a couple of examples. I knew what technologies were used and roughly how do it, but my searching was pretty bad. thanks
Re: javascript forms
Thats what I was thinking. I put it down to it being late
Re: javascript forms
I was just about to record a tutorial Lets see how well that goesjonathon wrote:Thats what I was thinking. I put it down to it being late
Re: javascript forms
Haha,
Do it! I do enjoy your freestyling. Especially when you've got an afflication like a cold Kudos
Do it! I do enjoy your freestyling. Especially when you've got an afflication like a cold Kudos
Re: javascript forms
Its a basics one too, no preperationjonathon wrote:Do it! I do enjoy your freestyling
Re: javascript forms
It wouldn't be the same if you didn't get to 9 minutes and decide that you'd talked for a long time and then regretted it