PDA

View Full Version : Switch content bug: can't find the problem!



Alexandervandongen
01-11-2006, 12:35 PM
Hi,

I am using a rewritten version of the Switch Content script II which shows all divs initially contracted. The problem is that when I put a form with more than one input fields in the switchable div, it is no longer possible to submit the form by hitting the enter key.
The problem only occurs in internet explorer and not in Firefox!

You can see my problem over here:
http://home.student.uva.nl/alexander.vandongen/linxhandig/test/switchcontentbug.htm

Has anyone any idea. You would help me alot!

Thanks, Alexander

Twey
01-11-2006, 04:23 PM
Works for me in all the browsers I tried it in, save Konqueror, where the entire script was unworkable.

Alexandervandongen
01-11-2006, 06:20 PM
Works for me in all the browsers I tried it in, save Konqueror, where the entire script was unworkable.

The script works fine for opening and closing divs, but it prevents me from submitting the form on this page
( http://home.student.uva.nl/alexander.vandongen/linxhandig/test/switchcontentbug.htm ) by hitting enter. The problem occurs only in internet explorer and not in Firefox.

Any ideas???

jscheuer1
01-11-2006, 08:29 PM
Yeah, Twey doesn't do Windows so, he is out in left field on this one. Try this script in the head:


<script type="text/javascript">
function ieSubmit(e, el){
if (document.documentElement.filters){
if (e.keyCode=='13'){
el.submit()
return false;
}
}
}
</script>

and this code for your form:


<div id="sc1" class="switchcontent">
<b>find telephone number:</b>
<form onkeydown="return ieSubmit(event, this);" name="tel" target="_blank" method="get" action="http://www.nationaletelefoongids.nl/ntlist.asp">
looking for <input type="text" accesskey="t" name="bname" class="zoekendubbelvoorbeeld" value=" Jansen">
in <input type="text" name="city" class="zoekendubbelvoorbeeld" value=" Leiden">
<input type="image" src="knoppen/zoeken.gif" width="8" height="9" border="0">
</form>
</div>

Twey
01-12-2006, 03:49 PM
Twey doesn't do Windows so, he is out in left field on this one.I actually tried installing Windows in qemu just so I could use IE to test these things, but then found out that my Windows install disk was battered beyond repair, and made horrible grinding noises in my disk drives. :(

Alexandervandongen
01-13-2006, 10:56 PM
It works! John, you are my hero! You not only helped me, but a lot of my visitors too.

Thanks!

Alex