different query results depending on browser

I have a query to bring back ALL records from a states table in a SQL 2008 db.
Using firefox the dynamically populated drop down shows every record.
Using IE... it skips one and so I can never have what's called "All States" which is the first row in the table.

Anyone else have this issue?
ecpeelAsked:
Who is Participating?
 
duncancummingConnect With a Mentor Commented:
Could be a Javascript error?  Show us your code.
0
 
ecpeelAuthor Commented:
Query:
<cfquery name="getStates" datasource="#ds#">
SELECT dbo.states.stid, dbo.states.state_code, dbo.states.state_name
FROM dbo.states
ORDER BY 1
</cfquery>

<form  name="SearchGranteesForm"action="" method="post">
<table width="400" border="0">
  <tr>
    <td width="200">Grantee/Center name:</td>
    <td><input type="text"  width="200" value="" name="GranteeName" /></td>
  </tr>
  <tr>
    <td>Grant Number:</td>
    <td> <input type="text" width="200" value="" name="GrantNumber" /></td>
  </tr>
  <tr>
    <td>City:</td>
    <td><input type="text" width="200" value="" name="Center_City" /></td>
  </tr>
  <tr>
    <td>State: </td>
    <td><select name="Center_State" <cfoutput query="getStates"> <option value="#state_name#"> #state_name#</option></cfoutput></select></td>
  </tr>
  <tr>
    <td><input type="submit" name="btnSearch" value="Search"><input name="" type="submit" onClick="window.close()"  value="Clear"/></td>
    <td>&nbsp;</td>
  </tr>
</table>
</form> 

Open in new window

0
 
ecpeelAuthor Commented:
Here's what seemed to fix this:
I included a "reset" submit button and that did it. Without I believe the code was non-compliant HTML. Who knew IE would become so sensitive?
Thanks
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
ecpeelAuthor Commented:
I appreciate the effort as it lead me to reconsider important elements of HTML design.
0
 
duncancummingCommented:
<tr>
    <td>State: </td>
    <td><select name="Center_State" <cfoutput query="getStates"> <option value="#state_name#"> #state_name#</option></cfoutput></select></td>
  </tr>
  <tr>
    <td><input type="submit" name="btnSearch" value="Search"><input name="" type="submit" onClick="window.close()"  value="Clear"/></td>
    <td> </td>
  </tr>


It may just be a cut-and-paste error, but your <select> tag hasn't got a closing >.  Should be
<select name="Center_State"> <cfoutput query="getStates">

Also I'm not sure if you can specify an empty name like this (why would you want to?)
name=""

And you're using XHTML style closing tags (the /> ), but that only works if your doctype is XHTML.  If it's HTML 4 those aren't valid.  But that shouldn't cause a problem for IE, it'll just render it in quirks mode.
0
 
ecpeelAuthor Commented:
@duncancumming:
I did catch that unclosed select tag after I posted. It didn't make the difference. I am using
"<html xmlns="http://www.w3.org/1999/xhtml">" but again it wasn't until I added a reset button that the query acknowledged the first row returned from the table.
Muchcho thanks.
I haven't attempted to duplicate the error by removing the reset button.
0
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.

All Courses

From novice to tech pro — start learning today.