HTMLSelecctTag_Behaviour

I have a web page that is built dynamically and displays addres info from a database.

One of the fields is "State".

I noticed a few times firefox 3.6 would not display the seleced state in the dropdown list correctly. This causes an issue as if user saves the form the state in the DB becaomes null.
for example, in list below it did not show "Arizona" as selected.

It does not seem to happen with IE. I also checked that table tags and every ROW and DATA tag has a matching one.

The issue does not happen all the time though. I cant tell what causes it.

I use this DOCTYPE declartion and i was wondering if it has to do with it.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">



This is the list i have

td>
           <SELECT NAME="p_state" TITLE="Select State.">
         <OPTION VALUE="">Select State</OPTION>
        <OPTION VALUE="AA">AA</OPTION>
        <OPTION VALUE="AB">ALBERTA</OPTION>
        <OPTION VALUE="AE">AE</OPTION>
        <OPTION VALUE="AK">Alaska</OPTION>
        <OPTION VALUE="AL">Alabama</OPTION>
       
        <OPTION VALUE="AP">AP</OPTION>
        <OPTION VALUE="AR">Arkansas</OPTION>
        <OPTION VALUE="AZ" selected>Arizona</OPTION>
        <OPTION VALUE="BC">BRITISH COLUMBIA</OPTION>
        <OPTION VALUE="CA">California</OPTION>
        <OPTION VALUE="CO">Colorado</OPTION>
        <OPTION VALUE="CT">Connecticut</OPTION>
        <OPTION VALUE="DC">District of Columbia</OPTION>
        <OPTION VALUE="DE">Delaware</OPTION>
       
        <OPTION VALUE="FL">Florida</OPTION>
        <OPTION VALUE="GA">Georgia</OPTION>
        <OPTION VALUE="GU">Guam</OPTION>
        <OPTION VALUE="HI">Hawaii</OPTION>
        <OPTION VALUE="IA">Iowa</OPTION>
        <OPTION VALUE="ID">Idaho</OPTION>
        <OPTION VALUE="IL">Illinois</OPTION>
        <OPTION VALUE="IN">Indiana</OPTION>
        <OPTION VALUE="KS">Kansas</OPTION>
       
        <OPTION VALUE="KY">Kentucky</OPTION>
        <OPTION VALUE="LA">Louisiana</OPTION>
        <OPTION VALUE="MA">Massachusetts</OPTION>
        <OPTION VALUE="MB">MANITOBA</OPTION>
        <OPTION VALUE="MD">Maryland</OPTION>
        <OPTION VALUE="ME">Maine</OPTION>
        <OPTION VALUE="MI">Michigan</OPTION>
        <OPTION VALUE="MN">Minnesota</OPTION>
        <OPTION VALUE="MO">Missouri</OPTION>
       
        <OPTION VALUE="MS">Mississippi</OPTION>
        <OPTION VALUE="MT">Montana</OPTION>
        <OPTION VALUE="NB">NEW BRUNSWICK</OPTION>
        <OPTION VALUE="NC">North Carolina</OPTION>
        <OPTION VALUE="ND">North Dakota</OPTION>
        <OPTION VALUE="NE">Nebraska</OPTION>
        <OPTION VALUE="NH">New Hampshire</OPTION>
        <OPTION VALUE="NJ">New Jersey</OPTION>
        <OPTION VALUE="NL">NEWFOUNDLAND AND LABRADOR</OPTION>
       
        <OPTION VALUE="NM">New Mexico</OPTION>
        <OPTION VALUE="NS">NOVA SCOTIA</OPTION>
        <OPTION VALUE="NT">NORTHWEST TERRITORIES</OPTION>
        <OPTION VALUE="NU">NUNAVUT</OPTION>
        <OPTION VALUE="NV">Nevada</OPTION>
        <OPTION VALUE="NY">New York</OPTION>
        <OPTION VALUE="OH">Ohio</OPTION>
        <OPTION VALUE="OK">Oklahoma</OPTION>
        <OPTION VALUE="ON">ONTARIO</OPTION>
       
        <OPTION VALUE="OR">Oregon</OPTION>
        <OPTION VALUE="PA">Pennsylvania</OPTION>
        <OPTION VALUE="PE">PRINCE EDWARD ISLAND</OPTION>
        <OPTION VALUE="PR">Puerto Rico</OPTION>
        <OPTION VALUE="QC">QUEBEC</OPTION>
        <OPTION VALUE="RI">Rhode Island</OPTION>
        <OPTION VALUE="SC">South Carolina</OPTION>
        <OPTION VALUE="SD">South Dakota</OPTION>
        <OPTION VALUE="SK">SASKATCHEWAN</OPTION>
       
        <OPTION VALUE="TN">Tennessee</OPTION>
        <OPTION VALUE="TX">Texas</OPTION>
        <OPTION VALUE="UT">Utah</OPTION>
        <OPTION VALUE="VA">Virginia</OPTION>
        <OPTION VALUE="VI">U.S. Virgin Islands</OPTION>
        <OPTION VALUE="VT">Vermont</OPTION>
        <OPTION VALUE="WA">Washington</OPTION>
        <OPTION VALUE="WI">Wisconsin</OPTION>
        <OPTION VALUE="WV">West Virginia</OPTION>
       
        <OPTION VALUE="WY">Wyoming</OPTION>
        <OPTION VALUE="YT">YUKON TERRITORY</OPTION>
        </SELECT>
            </td>

sam15Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dave BaldwinFixer of ProblemsCommented:
That DOCTYPE declaration is incomplete.  Should be:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">

from http://www.w3.org/QA/2002/04/valid-dtd-list.html
0
sam15Author Commented:
is this mandatory? you think that may cause issues?

I had webpages where I started with <HTML> and they seemed tow work fine.
Do you think it will cause unpredictable issues with browsers.
0
Michel PlungjanIT ExpertCommented:
Never heard of such a thing.

you are sure there are not other things going on?

Did you try firebug to see what is sent?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dave BaldwinFixer of ProblemsCommented:
sam15, you have argued with every suggestion made on your questions so far.  You asked, I answered with a link to the standards for DOCTYPES.  I know that incomplete DOCTYPES cause the browser to act differently.  Sometimes only slightly.  But the purpose of DOCTYPES is to tell the browser what standards to use when interpreting a web page.
0
sam15Author Commented:
I did change the DOCTTYPE and problem persists.

I think i know what causes this strange behaviour which seemsto happen only with firefox 3.6.

I have 3 different state dropdown lists on the page. Each has a different name like: p_state, p_ag_state, p_ad_state.

WHen the database value was set to california, the 3rd dropdown was showing alabama selected even though the "VIEW SOURCE" shows california being selected.

WHen I commented the first two state dropdown lists, the 3rd one displayed correctly and set at california. The first one was set to alabama and browser seems to apply same selection to the 3rd one which is kind of strange.



0
Dave BaldwinFixer of ProblemsCommented:
I didn't expect the DOCTYPE would fix the dropdown problem.  I have Firefox 3.6.17 running on one computer and it shows no problems for me with your dropdown list.  I'm wondering if that copy of Firefox has a problem.  Show us the whole page (please put it in the code section this time) so we have a chance of figuring out what is going on.  Since you said it worked in all the other browsers, it may be time to give up this problem that no one else can duplicate.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sam15Author Commented:
Yes, but as  I explained i do not think you tested with 3 state dropdown lists on same page. If you only have one dropdown list selection works fine. I will save a copy and post the page.
0
sam15Author Commented:
I could not replicate the issue again today. BUt now I am suspecting that IFerfox maybe getting a webpage from cache instead from database. but still the view source for selected state should match the web screen display.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.