Re: [PHP] HTML/PHP's static state problem.
And don't forget the 'no-no' of requiring javascript for basic functionality... Split it onto 2 pages, or have it resubmit to $PHP_SELF with a hidden field (how about a button that says Get Cities ?) and populate from there.. If you're hell-bent on having it auto-populate the second select box, may i request that it also work when JS is turned off? -- Aaron - Original Message - From: Maxim Maletsky [EMAIL PROTECTED] To: Boget, Chris [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED]; [EMAIL PROTECTED]; Alexander Deruwe [EMAIL PROTECTED] Sent: Monday, July 09, 2001 10:02 AM Subject: RE: [PHP] HTML/PHP's static state problem. That is why I am saying - loading two pages is cooler then do it all on one. Some people are still scratching the web on 28 and 36 K - those gonna get sick submitting your form. Plus a page view. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 1:51 AM To: 'PHP'; [EMAIL PROTECTED]; Alexander Deruwe Subject: RE: [PHP] HTML/PHP's static state problem. I've done this very thing for a leasing company. I used PHP and MySQL to create a series of arrays in Javascript. When the user clicked on a value in the first combobox I used onClick to call a function which loaded information into the second box. A definite possibility. The only downside being is if there is *alot* of data it'll take a while for the user to DL the page. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML/PHP's static state problem.
Hello Maxim, Basically I mean this: I load the page, it has two comboboxes (select with option). The first one contains names of countries, the second names of cities within those countries. When I select Belgium in the first one, I only want to see all Belgian cities. Now with JavaScript this wouldn't really be a problem, I guess, but I need PHP for going into my database. Any ideas? Alexander 'ad' Deruwe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTML/PHP's static state problem.
Then still a JavaScript: Find a code that loads or submits the page (passing a var) when selecting/clicking on a country in the select list. Then using your variable contains the country get the needed cities. That is the only way to 'emulate' JS. You could also provide an HTML text list of countries, and then under it the list of cities, and so on and so on... I would try to do it step-by-step: You select your country first, then on the next page select your city and then on the next page fill in the form. Page 2 and 3 can actually be together if you wish. I kinda don't like JavaScript (except for intranet sites, where usability is the must), too long code, too bad compatibility, too easy to disallow... Hope this helps, Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Alexander Deruwe [mailto:aderuwe@mayhem]On Behalf Of Alexander Deruwe Sent: Tuesday, July 10, 2001 3:39 AM To: Maxim Maletsky Cc: [EMAIL PROTECTED] Subject: Re: [PHP] HTML/PHP's static state problem. Hello Maxim, Basically I mean this: I load the page, it has two comboboxes (select with option). The first one contains names of countries, the second names of cities within those countries. When I select Belgium in the first one, I only want to see all Belgian cities. Now with JavaScript this wouldn't really be a problem, I guess, but I need PHP for going into my database. Any ideas? Alexander 'ad' Deruwe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTML/PHP's static state problem.
Basically I mean this: I load the page, it has two comboboxes (select with option). The first one contains names of countries, the second names of cities within those countries. When I select Belgium in the first one, I only want to see all Belgian cities. Now with JavaScript this wouldn't really be a problem, I guess, but I need PHP for going into my database. What I do is this: Where I set up the form, for the first combo box, I fill it using the results from the query: SELECT * FROM countries and name that combo box country_name. I set an event on this combo box to be OnChange=form.submit(); For the second combo box, I use the query: SELECT * FROM cities WHERE country=\$country_name\ So the combo box will be empty the first time into the page but each time they select a new country, it gets filled appropriately. I have some checks to determine where the form submission is coming from so I know whether or not to actually process the data. HTH Chris
Re: [PHP] HTML/PHP's static state problem.
If it's not prohibitive, you can pre-load all the possibilities into javascript arrays via PHP, and decide which to subset to display using javascript. I did this on a large on-line kid's encyclopedia, where the page could display different lists of links using javascript depending on where they clicked. As an alternative, if your user interface is done in Flash, then it's a simple matter to query the server for the list of cities to display whenever the first has a new selection. - Tim http://www.phptemplates.org The first one contains names of countries, the second names of cities within those countries. When I select Belgium in the first one, I only want to see all Belgian cities. Now with JavaScript this wouldn't really be a problem, I guess, but I need PHP for going into my database. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HTML/PHP's static state problem.
As a matter of fact you can create dynamic comboboxes, but not with soley PHP. Because PHP is server-side, it has no idea what the user has selected on a form, etc. JavaScript, on the other hand, is client-side, so it keeps track of what the user is doing. I've done this very thing for a leasing company. I used PHP and MySQL to create a series of arrays in Javascript. When the user clicked on a value in the first combobox I used onClick to call a function which loaded information into the second box. - Original Message - From: Alexander Deruwe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 12:17 PM Subject: [PHP] HTML/PHP's static state problem. Hey all, I've run into a little problem: Take, for example, combobox A and combobox B. Suppose B's options depend on what is selected in A.. Is it possible to update B according to what is selected in A? Thanks, Alexander 'ad' Deruwe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] HTML/PHP's static state problem.
I've done this very thing for a leasing company. I used PHP and MySQL to create a series of arrays in Javascript. When the user clicked on a value in the first combobox I used onClick to call a function which loaded information into the second box. A definite possibility. The only downside being is if there is *alot* of data it'll take a while for the user to DL the page. Chris
RE: [PHP] HTML/PHP's static state problem.
That is why I am saying - loading two pages is cooler then do it all on one. Some people are still scratching the web on 28 and 36 K - those gonna get sick submitting your form. Plus a page view. Sincerely, Maxim Maletsky Founder, Chief Developer PHPBeginner.com (Where PHP Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: Boget, Chris [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 10, 2001 1:51 AM To: 'PHP'; [EMAIL PROTECTED]; Alexander Deruwe Subject: RE: [PHP] HTML/PHP's static state problem. I've done this very thing for a leasing company. I used PHP and MySQL to create a series of arrays in Javascript. When the user clicked on a value in the first combobox I used onClick to call a function which loaded information into the second box. A definite possibility. The only downside being is if there is *alot* of data it'll take a while for the user to DL the page. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]