Gossamer Forum
Home : Products : DBMan : Customization :

Select field depended of other

(Page 2 of 2)
> >
Quote Reply
Re: Select field depended of other In reply to
I don't know about making a separate script. That's something you're going to have to try for yourself and see if it works.

Now I need a sample Javascript thing (what are they called?) for creating the sort of lists that you want. I just want you to give me the actual Javascript, not a bunch of other stuff (I get lost in the code very easily), and one that just has a few options. All I need is a way to figure out what the syntax is for the Javascript. I was looking on the 'net, but I couldn't find the page I had found before with the info on it.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
Did you take the select field of the LEFT bottom frame, thats the one I mean. You select one of the first four 'makes' (try 'BMW'), than a second select field come up, with all the models, witch I put in a file. But behind those two screens, are the Javascripts you need. Do not take the select field in the center, within 'Hoofdmenu'.
----------
Mart.
Quote Reply
Re: Select field depended of other In reply to
I see one select field on this page. On the left, there are 6 broken images that link to somewhere, all in one column and at the bottom there is "Autorandstad Favoriet!!" (In Netscape that last thing says "Autorandstad
Favoriet!;toets FrownCTRL-D)")

I have looked at the page with both Netscape and Internet Explorer -- the latest versions of both. There is not a fill-in select field on that page, nor did I see anything in the source code that would indicate there was a fill-in select field on that page.

If I need to click some link to get to the fill-in select field, please tell me.



------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
What I need is a sample Javascript that shows how to fill in one select field based on the selection in another select field. I saw one somewhere that listed areas of the world --

North America
South America
Europe
Asia
Africa

and some others and then listed the countries in each one, so that when a user selected, for example, Europe, the next select field would give the choices of

Denmark
France
Germany
Holland
Italy
United Kingdom

(and others).

I don't know where I saw the script. I've been looking for it off and on all day. If I could find the script, I would be able to tell you how to use the code I've already given you to fill out the select fields. But, until I see the format for the Javascript code, the Perl code I gave you so far is just an interesting, but useless, exercise.

As for what you do with it, I don't have the slightest idea. My thought would be that you would use it instead of the select field you have on your page right now. But you can try to put it anywhere you want.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
Thats exactly what happens with my JavaScript. It loads a file, depending from what the select value is.
Now, instead of loading a file, it should do the second search for the 'models' and fill the option values with it with a 'document.write' event. Look at the source of the frame I talked about before, than select for example 'BMW' and take the source again. Compare those two sources and you see what I mean. OK???
Quote Reply
Re: Select field depended of other In reply to
On the page you gave me, there is only one select field. When I select something from that field, it takes me automatically to the search results. There is no second field which is filled in from the results of the first one. The only Javascript I see is one that redirects the user to the search, based on the selection from the field. This is not what I need.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
OK, you give me the idea, to put the whole thing in another sub_html_..., and call it just like a footer, what do you think of this??
The Javascript I've made, is on www.autorandstad.nl/particulieren1 , in the left-bottom frame, look at the source-code. Only the first four 'makes' will work. If this is not what you're looking for, I'll see and post it here. OK??? Smile

[This message has been edited by mart (edited September 01, 1999).]
Quote Reply
Re: Select field depended of other In reply to
Is there not a field just under 'Zoek snel:'?? I've posted a file with the Java code on http://www.autorandstad.nl/jpd_select_field.txt

Thanks.
---------
Mart.
Quote Reply
Re: Select field depended of other In reply to
There is no "Zoek snel:" when I go to http://www.autorandstad.nl/particulieren1 .

I read the code that you posted. I guess I'm still not understanding. You said
Quote:
When this is selected, the function 'jumpMerk(form)' calls the file 'select_make.htm'.[/code]
So you don't want two side-by-side select fields?

I did finally find the script I'd been looking for, at http://javascript.internet.com/forms/country.html . That's what I thought you wanted.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
I finally found it!! Smile But I had to open the top frame in a new window. On my browser (Netscape), the second select field was below the bottom edge of the top frame.

I'll keep the source code handy and I'll work on this after I get the other (quicker to answer) questions answered that are here. It will take me a little while to write the code.

The site is looking very nice. It's a little "busy" for my personal taste -- lots of things flashing and moving around -- but you certainly have added a lot of things to it! Smile


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
I looked at your source code and it does not populate the second select list with the contents of the first one. I need you to come up with the Javascript that will do that, because you know more about Javascript than I do. Once you have made the Javascript, I will give you the code to populate it with only the Makes and Models that are currently in your database.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
I've installed just a part of my final Site only for today on http://www.autorandstad.nl/start , in the second 'top-frame' there is 'Zoek Nu:', with one select field. When you select there 'BMW', there comes two select fields, with in the new one the models. Try it and only 'right-clicking' in that frame is possible.
BTW, how is the site looking???

Thanks
-------
Mart.
Quote Reply
Re: Select field depended of other In reply to
Sorry, its just the language problem. I do not quit understand exactly what you mean.
Is it the calling command for a function, as an 'onChange' event or do you mean something else...
Quote Reply
Re: Select field depended of other In reply to
If you go to http://javascript.internet.com/forms/country.html , you will see code which fills in the second select field based on what is selected in the first one. I think that's what you want to do.

My problem is that I don't understand enough about Javascript in order to be able to change that code to put in the values that DBMan generates into the arrays. I don't know what I need to change for the names of functions or the names of the select fields or what document.something.something means.

If you could pick up that script and use it as a template to just include 4 or 5 makes of cars, with 4 or 5 models of each car, then I wouldn't have to worry about the Javascript part and I could just focus on defining the arrays that you need.

------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
I already have given you the code that would give you the current Makes and their associated Models. Look at the last code I gave you. That's what it does.

If you want me to do any more than that, I will need to have you create the Javascript code so I'll know how to use the code I gave you already. I can't do anything else until you write the Javascript.


------------------
JPD





Quote Reply
Re: Select field depended of other In reply to
If you can give me the code, that takes care of the 'option values', so it produce an option list, I will try to implant it in my Java and post it, when its ready. OK???
It must start with displaying an select option list, with the makes and seperate I need a code, witch will give a select option list of the models, depending of the selected make.
Quote Reply
Re: Select field depended of other In reply to
Hi, I am just back of a two-day trip outside the country. I'll see what I can do tomorrow.
Quote Reply
Re: Select field depended of other In reply to
Hi Carol,
I want to bring this to your attention, I've got this runnung Smile, if your curious, take a look at my site http://www.autorandstad.nl/start , and see. I've wrote a seperate script (cron), whitch build the list of models outside of DBMan, because, when the number of records grow, the building of that list would take more time and could slow everything down Frown. I did it with your great help and also with the help of the javascript you pointed me to.

Thanks a lot.
----------
Mart.
Quote Reply
Re: Select field depended of other In reply to
Excellent, Mart! Very, very good!!! Smile


------------------
JPD





> >