Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is wrong?

Status
Not open for further replies.

skatcb

IS-IT--Management
Jun 2, 2003
14
US
Hi I have this page below, and in ie everything works great in netscape no go, what is wrong. It does not allow the nav bar pulled from the database to work correctly, also the search at the bottom does not work at all and the cart does not work. Sorry for the long post.
</head>
<%
sql="SELECT * FROM tblnav_bar"
RS.Open sql, strconn, 3, 3
%>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function clearthis(f){
f.value = "" }


function docart()
{
num = txtCartNum.value
location.href="cart_open.asp?num=" & num
}

function viewcart(){
location.href="cart.asp"
}

function djump(){
ref = ddown(ddown.selectedIndex).value
window.location.href="cards_ref.asp?xref=" & ref & "&pg=1&base=1"
}

status="Welcome to P.S. Bliss Cards!"
//-->
</SCRIPT>

<%
link1 = "#99ff66"
link2 = "pink"
link3 = "#66ffff"
link4 = "#ffff99"
link5 = "lavender"

i=1
rs.fields("link") = blank
%>
<table border="0" width="100%" id="tablea">
<tr>
<td width="50%" valign=middle><a href=default.asp><font class="title">P.S. Bliss Cards</font></a></td>

<td width="50%" valign=bottom align=left><p align="right"><font class=title2>Handmade Greeting Cards & Prints</font></td>
</tr>
</table>
<table border="0" id="tableb" cellspacing="5" cellpadding="7">
<tr>
<%
i=1
do until rs.eof
%>
<% if rs.fields("link") <> "" then %>
<td height=10 style="background: <%
if i=1 then
response.write(link1)
elseif i=2 then
response.write(link2)
elseif i=3 then
response.write(link3)
elseif i=4 then
response.write(link4)
elseif i=5 then
response.write(link5)
end if
%>;"><a href=<%= rs.fields("link") %>><font class="table-nav"><%= rs.fields("bartext") %></font></a></td>
<% else %>
<td height=10 style="background: <%
if i=1 then
response.write(link1)
elseif i=2 then
response.write(link2)
elseif i=3 then
response.write(link3)
elseif i=4 then
response.write(link4)
elseif i=5 then
response.write(link5)
end if
%>;" onmouseover="showtable table<%= i %>"><font class="table-nav"><%= rs.fields("bartext") %></font></td>
<% end if %>
<%
i=i+1
rs.movenext
loop
rs.movefirst
%>
</tr>
</table>
<table border=0>
<%
i=1
do until i = 3
%>
<%
rs.close

sql="SELECT * FROM tblsub_bar" & i
RS.Open sql, strconn, 3, 3
%>
<table border="0" id="table<%= i %>" cellspacing="5" cellpadding="2" style="visibility: hidden; position:absolute;">
<tr>
<%
do until rs.eof
%>
<td height=10 style="background: <%
if i=1 then
response.write(link1)
elseif i=2 then
response.write(link2)
elseif i=3 then
response.write(link3)
elseif i=4 then
response.write(link4)
elseif i=5 then
response.write(link5)
end if
%>;"><a href=cards.asp?cat=<%= rs.fields("bartext") %>&base=<%= i %>&pg=1><font class=table><%= rs.fields("bartext") %></font></a></td>
<%
rs.movenext
loop
%>
</tr>
</table>
<%
i=i+1
loop
%>
</table>
<table width=100%><tr><td align=right>

<% if request.cookies("cartnum") = "" then %>
<input type="text" name="txtCartNum" value="Cart Number" style="background=#fefefe;width=150" onclick="clearthis(this)" size="20"><br>
<button style="background=#fefefe;width=150" onclick="docart()"><img src=images/cart.jpg></button>
<% else %>
<font color=white>Cart Number <%= request.cookies("cartnum") %>.</font><br>
<button style="background=#fefefe;width=150" onclick="viewcart()"><img src=images/cart.jpg></button>
<% end if %>

<br><font color=white face=verdana style="font-size: 10pt">Search by Occasion: </font>
<select name=ddown>
<%
rs.close
sql="SELECT * FROM xref ORDER BY text ASC"
RS.Open sql, strconn, 3, 3
%>
<% do until rs.eof %>
<option value=<%= rs.fields("text") %>><%= rs.fields("text") %></option>
<%
rs.movenext
loop
%>
</select><button onclick="djump()" style="color: black; background: #99ff00">Go</button>
</td></tr></table>
 
Thats strange, usually for me ASP outputs the same thing no matter what browser is being used.

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
Netscape is not forgiving in Javascript. For instance, your one function should be:

function djump(){
ref = document.form1.ddown.options[document.form1.ddown.selectedIndex].value;
window.location.href="cards_ref.asp?xref=" & ref & "&pg=1&base=1";
return false
}

With the button object having:

onclick="return djump()"
 
All of the problems I encounter with Netscape vs IE have to do with either Javascript syntax or properly formatted tags(IE will forgive you if you forget to close a tag whereas Netscape often won't)

Netscape will often try to submit a form on a 'button' object click, so that is why the 'return false' is needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top