Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 11, 2008, 05:46:02 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Simple HTML works on FF but not IE7  (Read 1065 times)
matt56
Newbie
*
Offline Offline

Posts: 5


« on: February 28, 2008, 10:12:42 AM »

Clicking the French flag here (http://isales.com/fhs/simp.jsp) using FF changes the text to french.  Clicking the american flag switches back to english.  With IE7 clicking the French flag doesn't switch the text.  What did I do wrong?  Thanks!



<html>
<head>
<title></title>
</head>

<body bgcolor=e4e4e4>
<style type=text/css>
#table
{
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-right: 1px black solid
}
</style>
<center>
<table id=table border=0  cellspacing=0 cellpadding=0 bordercolor=black  width=600 bgcolor=ffffff>
<tr>
  <td colspan=3 width=600 ><img src="title.png"/></td>
</tr>
<tr>
<td width=200 ><a href="simp.jsp"><img src="home.png" border="0"/></a></td>
<td width=200 ><a href="announcements.jsp"><img src="announcements.png" border="0"/></a></td>
<td width=200 ><a href="tutoring.jsp"><img src="Tutoring.png" border="0"/></a></td>
</tr>
<tr><td colspan=3>
<div style=
   "border: solid 0 #000; border-top-width:1px; padding:1.5ex">
<table border=0 cellpadding=0>
<tr>
<td colspan=2 width=400>


Welcome to the Wheeler High School French Honor Society Website. French Honor Society is a national honorary organization that works to promote the knowledge of French language and culture.  The Society also serves to recognizes students who have proven themselves academically over the course of their French education.  Members of Wheeler?s French honor society also work to give back to the French community by tutoring rising French students.
null

</td>
<td width=200><img width=200 src="paris2.jpg"/><br>
<br>Sponsor: Madam Safir<br>
President:<br>
Secretary:<br>
Treasurer:<br>

</td>
</tr>
</table>
</div>

</tr>
<tr>
<td colspan=3><div align=right>
<form method=post action=simp.jsp>
<input type="image" name="lang" value= am src="amfg.png">
<input type="image" name="lang" value= fr src="frfg.png">
</form>

</tr>
</table>
</center>


</body>

</html>
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Online Online

Posts: 3393



« Reply #1 on: February 28, 2008, 03:56:49 PM »

Code:
<input type="image" name="lang" value= am src="amfg.png">
<input type="image" name="lang" value= fr src="frfg.png">

First, an "image" input type ignores the "value" setting, which isn't done correctly anyway (don't put blank between = and the value). Second, "image" input just returns mouse pointer coordinates. You might try using a different "name" for the two images. You might also just use an image submit button:

Code:
<button type="submit" name="english" value="english"><img src="amfg.png" alt="English" title="English" /></button>
<button type="submit" name="french" value="french"><img src="frfg.png" alt="French" title="French" /></button>

P.S. I'll bet Madame Safir isn't pleased to be labeled a "Madam"!!
Logged

matt56
Newbie
*
Offline Offline

Posts: 5


« Reply #2 on: March 01, 2008, 09:27:24 AM »

Thanks for the help but the new buttons have the same problem in that they work in FF but still do not work in IE7.
Logged
scanman20
Master Jedi
*****
Offline Offline

Posts: 1251



WWW
« Reply #3 on: March 01, 2008, 11:30:29 AM »

There must be code missing somewhere because in the code you posted the French text doesn't exist so I'm assuming your jsp page is processing something at some point.
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
matt56
Newbie
*
Offline Offline

Posts: 5


« Reply #4 on: March 01, 2008, 12:26:48 PM »

Code:
<%
if("fr".equals(request.getParameter( "lang")))
{
session.setAttribute("ltoggle","true");
}
else if("am".equals(request.getParameter( "lang")))
{
session.setAttribute("ltoggle","false");
}
else{}

%>

<html>
<head>
<title></title>
</head>

<body bgcolor=e4e4e4>
<style type=text/css>
#table
{
border-top: 1px black solid;
border-left: 1px black solid;
border-bottom: 1px black solid;
border-right: 1px black solid
}
</style>
<center>
<table id=table border=0  cellspacing=0 cellpadding=0 bordercolor=black  width=600 bgcolor=ffffff>
<tr>
  <td colspan=3 width=600 ><img src="title.png"/></td>
</tr>
<tr>
<td width=200 ><a href="simp.jsp"><img src="home.png" border="0"/></a></td>
<td width=200 ><a href="announcements.jsp"><img src="announcements.png" border="0"/></a></td>
<td width=200 ><a href="tutoring.jsp"><img src="Tutoring.png" border="0"/></a></td>
</tr>
<tr><td colspan=3>
<div style=
   "border: solid 0 #000; border-top-width:1px; padding:1.5ex">
<table border=0 cellpadding=0>
<tr>
<td colspan=2 width=400>

<%
if(("true").equals(session.getAttribute("ltoggle")))
{
String a = "Bienvenue au site Web français de société d'honneur de lycée de Wheeler. La société française d'honneur est une organisation honorifique nationale qui travaille pour favoriser la connaissance de la langue et de la culture françaises. La société sert également identifie les étudiants qui se sont prouvés scolaire au-dessus du cours de leur éducation française. Les membres de la société française de l'honneur du Wheeler travaillent également pour donner de nouveau à la communauté française par les étudiants français se levants de cours particuliers.";
String b = new String(a.getBytes("UTF-8"), "UTF-8");
out.println(b);
%>

<%}
else{
%>
Welcome to the Wheeler High School French Honor Society Website. French Honor Society is a national honorary organization that works to promote the knowledge of French language and culture.  The Society also serves to recognizes students who have proven themselves academically over the course of their French education.  Members of Wheeler’s French honor society also work to give back to the French community by tutoring rising French students.
<%}%>
</td>
<td width=200><img width=200 src="paris2.jpg"/><br>
<br>Sponsor: Madame Safir<br>
President:<br>
Secretary:<br>
Treasurer:<br>

</td>
</tr>
</table>
</div>

</tr>
<tr>
<td colspan=3><div align=right>
<form method=post action=simp.jsp>
<input type="image" name="lang" value= am src="amfg.png">
<input type="image" name="lang" value= fr src="frfg.png"><br>
<button type="submit" name="lang" value="am"><img src="amfg.png" alt="English" title="English" /></button>
<button type="submit" name="lang" value="fr"><img src="frfg.png" alt="French" title="French" /></button>
</form>

</tr>
</table>
</center>


</body>

</html>






Logged
matt56
Newbie
*
Offline Offline

Posts: 5


« Reply #5 on: March 02, 2008, 08:56:03 AM »

I just read something suggesting that using input type to pass a value is not supported in IE7, but is in FF (<input type="image" name="lang" value= am src="amfg.png">).  Could this be my problem?  If so, does anyone have a workaround?
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Online Online

Posts: 3393



« Reply #6 on: March 02, 2008, 12:39:21 PM »

A few comments and observations:

1) Never use Word as an editor for web pages. You'll notice that it uses "smart quotes" for various ' and " instances, that aren't valid in HTML. Thus ...of Wheeler's French honor... shows up as ...of Wheeler?s French honor... . Word may also deposit invisible droppings that are messing up something. The first thing to do is switch to a flat file editor such as vim, Emacs, or even Notepad, and see if that doesn't clear up some of the problems.

2) I tried the page in FF2 (all buttons worked fine) and IE6 (did not switch to French). It was interesting that in some cases the amfg.png did not show up in FF2, but did show up in IE6.

3) "input" tags are self-closing. End with />: <input ...... />.

4) All attributes in HTML tags should be in quotes "" or '', just to be on the safe side (width="400" rather than width=400). Also, the body background color should be bgcolor="#e4e4e4" (you should always use the # for numeric RGB triplets).

5) It's possible that having the "lang" variable set in 2 different kinds of tags may be confusing to the system. I would simplify things by using either the "input" or the "button" tags, but not both.

At this point, I don't know why the server would care whether the browser was FF or IE, but it may make a difference in that something is being passed back incorrectly on the submit. The HTML code sent to FF and to IE is the same, except that IE has an <img> tag with the current language choice and FF is "null". That might be a hint. Try implementing all my suggestions above and see if it makes any difference.

To reiterate, the <input type="image"> tag is meant for selecting a point within an image (the x and y coordinates are returned). For your purposes, which is simply to submit the form when the flag image is clicked on (and you don't care where in the image), I would suggest <button type="submit"> with an <img> content.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM