Solved

different query results depending on browser

Posted on 2009-04-06
6
157 Views
Last Modified: 2013-12-24
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?
0
Comment
Question by:ecpeel
  • 4
  • 2
6 Comments
 
LVL 16

Accepted Solution

by:
duncancumming earned 500 total points
ID: 24081438
Could be a Javascript error?  Show us your code.
0
 

Author Comment

by:ecpeel
ID: 24081700
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
 

Author Comment

by:ecpeel
ID: 24082337
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
Free camera licenses with purchase of My Cloud NAS

Milestone Arcus software is compatible with thousands of industry-leading cameras for added flexibility. Upon installation on your My Cloud NAS, you will receive two (2) camera licenses already enabled in the software. And for a limited time, get additional camera licenses FREE.

 

Author Closing Comment

by:ecpeel
ID: 31567223
I appreciate the effort as it lead me to reconsider important elements of HTML design.
0
 
LVL 16

Expert Comment

by:duncancumming
ID: 24084443
<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
 

Author Comment

by:ecpeel
ID: 24091579
@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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now