Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 21st, 2005, 09:00 PM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why does Mozilla NOT work

I am trying to use the following code shown below

The problem is that it works fine in IE & Opera, but fails in any Mozilla product


<%
  If Not objRS.EOF Then
  objRS.MoveFirst
%>
  <form method="get" action= "<%= strURL %>">
  <select name="search">
  <option>Select Class</option>
<%
  Do While Not objRS.EOF
%>
  <option value><%= objRS.Fields("lclas") %></option>
<%
objRS.MoveNext
Loop
%>
</select>
<%
end if
objRS.Close
Set objRS = Nothing
objDC.Close
Set objDC = Nothing
strsearch = trim(Request.QueryString("search"))
response.write "strsearch passed is.. "
response.write strsearch

When in IE the response write shown for example is

"strsearch passed is.. A-2"

but in Mozilla all I get is

"strsearch passed is.."

in consequence my sql statement fails because there is nothing to search on ???

I just cannot see why something this basic is falling over
so any help here would be much appreaciated

Thanks

Topshed
 
Old January 21st, 2005, 09:06 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please modify the following line:
 <option value><%= objRS.Fields("lclas") %></option>
as
 <option value= "<%=objRS.Fields("lclas")%>"><%=objRS.Fields("lcla s")%></option>

Om Prakash
 
Old January 22nd, 2005, 01:59 AM
Authorized User
 
Join Date: Sep 2003
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you SO much an instant fix..

Could you please explain Why it only failed on Mozilla ?

Regards Topshed

 
Old January 24th, 2005, 05:36 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

It failed in Mozilla because <option value> is not the valid syntax. IE ignores the error and returns the content.

But for Mozilla, this is invalid syntax, so no values are returned.

Following are valid syntax:
 <option>TEST</option>
 <option value = "1">TEST</option> (If text/value is different)

Below code can also be written as:
 <option><%= objRS.Fields("lclas") %></option>
instead of
 <option value= "<%=objRS.Fields("lclas")%>"><%=objRS.Fields("lcla s")%></option>



Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
mozilla/IE 7 differences Adam H-W CSS Cascading Style Sheets 2 July 9th, 2007 04:16 AM
xmlhttprequest - mozilla alexena XML 0 August 23rd, 2006 07:16 AM
XMLHTTP and Mozilla dazzled XML 1 March 10th, 2006 06:22 AM
pasteHTML() for mozilla ? Farooq Javascript 0 December 21st, 2005 07:39 AM
Mozilla don't support rickytang CSS Cascading Style Sheets 1 September 18th, 2004 03:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.