AJAX Dropdown with Firefox

T

The Magnet

Hi,

I have this weird problem with Firefox & IE. I have a page with
dynamically generated dropdowns using AJAX & PHP. Problem is that
when the second dropdown is called, it loses the value of the first
dropdown? Is there something I should know about this?

It works fine in IE and retains the value. But not with Firefox....
 
E

Evertjan.

The Magnet wrote on 02 nov 2009 in comp.lang.javascript:
I have this weird problem with Firefox & IE. I have a page with
dynamically generated dropdowns using AJAX & PHP. Problem is that
when the second dropdown is called, it loses the value of the first
dropdown? Is there something I should know about this?

How can you call a dropdown?
How can dropdowns remember the value of another dropdown?
What is a dropdown, an html select element?

I had this Christal ball, but I dropped it,
now I cannot comment on code that isn't there.
 
T

The Magnet

The Magnet wrote on 02 nov 2009 in comp.lang.javascript:


How can you call a dropdown?
How can dropdowns remember the value of another dropdown?
What is a dropdown, an html select element?

I had this Christal ball, but I dropped it,
now I cannot comment on code that isn't there.

Maybe I not explaining this properly, but I know this is a very common
thing, and it works in IE.

User selects some value in box #1, AJAX/PHP dynamically generates box
#2. User selects from box #2, values are passed to AJAX/PHP script to
be processed.

I works fine in IE, but not in Firefox, so, something is strange about
the different browser. Probably some dumb thing not following
standards.
 
T

Thomas 'PointedEars' Lahn

The said:
I have this weird problem with Firefox & IE. I have a page with

Do you mean an HTML document?
dynamically generated dropdowns using AJAX & PHP.

AJAX is a technique. PHP is a programming language. Relevance?
Problem is that when the second dropdown is called,

Dropdowns are _not_ called. There is no real dropdown widget in HTML to
begin with, that is only one possible representation of SELECT elements.
it loses the value of the first dropdown?

Perhaps a request takes place, so that the value of the second SELECT
element is submitted and the value of the first one is not. Perhaps not.
Is there something I should know about this?

Yes, you should know the relevant source code or the URL and tell us about
either or both.
It works fine in IE and retains the value. But not with Firefox....

Probably written by someone not knowing what they are doing, employing an
ActiveXObject-only solution which would not work in anything but an MSXML-
supporting environment (so also not in Opera, Safari etc.)

<http://jibbering.com/faq/#posting>



PointedEars
 
J

JR

Maybe I not explaining this properly, but I know this is a very common
thing, and it works in IE.

User selects some value in box #1, AJAX/PHP dynamically generates box
#2.  User selects from box #2, values are passed to AJAX/PHP script to
be processed.

I works fine in IE, but not in Firefox, so, something is strange about
the different browser.  Probably some dumb thing not following
standards.

Unless the options list is very long, I'd suggest using PHP code to
write that list in an array or object literal (a javascript code
written by PHP code). Then it would be easier to refill select #2
according to the options chosen in select #1. Anyway, it's easy to
test what's going wrong if you run the PHP page called by the AJAX
code with the select #1 selected option.

Cheers,
JR
 
N

NickFitz

I works fine in IE, but not in Firefox, so, something is strange about
the different browser.  Probably some dumb thing not following
standards.

"Some dumb thing not following standards" sounds like an adequate
description of IE. If you've written your code to work in IE, then it
is very unlikely to work correctly in an environment that supports
standards. Are you seeing the same problem in Opera, Safari, Chrome?

However, it is impossible to suggest what might be the root cause of
your problem without seeing some code, or preferable the URL of a test
case.

Regards,

Nick.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top