Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2006, 04:12 PM
Ov1 Ov1 is offline
Registered User
 
Join Date: Jul 2006
Location: , , Mauritius.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why does this work in Firefox but not in IE????

Hi there. Can someone shed some light into this?
I'm using a CSS button for a login page. When i press enter on the input field my form is submitted but when i click on the button nothing happens. However, if i use Firefox, both pressing enter and clicking the button submits the form. How can i amend my code so that it works in IE also?
Any1?

Code:
 <form name="login" action="asp/check_login.asp" method="post">
bla bla bla
<td align="left"><a href="javascript:void(0);" class="TextButt" onClick="valogin();">Log in</a>
The javascript function valogin is :
Code:
function valogin ()
{
var error=0;

if (isBlank(document.frmlogin.User.value))
{
    error++;
}

if (isBlank(document.frmlogin.Pass.value))
{
    error++;
}

if (error==0)
{
    document.frmadminlogin.submit();
}
}
Regards,
Ov1
Reply With Quote
  #2 (permalink)  
Old August 11th, 2006, 04:22 AM
HLH HLH is offline
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello,

I have no idea of ASP (i´m php programmer) but my problem has exactly the same title than this one, so i will post it here.

ok, I hate IE :(, but I need to program things for it. And this code does not work. In my main file have a table where each row has two DIVs. the code is the following:

Code:
<DIV id="bloques">
<table class="tabbloques" ><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr><tr><td>
<DIV class="bloque"></div><DIV class="inbloque" >Cargando...</div>
</td></tr></table>
</div>
well, then I try to attach events to them: when I click on "bloque" DIV, I want "inbloque" to appear and disappear (really easy).

I use the Eventutil.js code from Nick Zakas book. My code is the following:



Code:
function clickblock() {
    var bloqs = document.getElementById("bloques");

    var divs = bloqs.getElementsByTagName('DIV');
    alert(divs.length);
    var divCounter = 1;

    for(var no=0;no<divs.length;no++){
        if(divs[no].className=='bloque'){
        divs[no].id = 'bloque'+divCounter;
        divs[no].nextSibling.id = 'inbloque'+divCounter;

        EventUtil.addEventHandler(divs[no], 'click', toggle);

          divCounter ++;
          }
      }

}
I mean, I search for DIVS inside "bloques" and I alternate them the IDs and I attach the clickon toggle function to "bloqueX" DIVS.

It works properly in FF, but... in IE I have the following behaviour:

- If I execute the code as it is above, only the first DIVS couple will work (I mean, the toogle function will work).
- If I remove the TABLE, TR and TDs tags, then it won´t work in the FIRST couple of tags but it will work in the rest 9 cople of DIVS tags!!



I have no idea what is happening. If I can´t solve this I will have to detect the browser from the server-side and Use different PHP code for each :(


I hate IE
Reply With Quote
  #3 (permalink)  
Old August 11th, 2006, 05:47 AM
HLH HLH is offline
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well... I think I found the problem (but I can´t belive it). With the code I wrote:

- The first DIV aplies the toggle function to ALL the content of the div (you can click anywhere and it works).
- For the rest od DIVS... I had to add some text and click on it (in my example it was empty so thats why it did not work), because the toggle function (in these cases) does not aply to ALL the DIV, but only to the content (text) of it.

behaviour???:(:(

do you know why IE has this behaviour???



I hate IE
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Css layout not work well in Firefox kumiko CSS Cascading Style Sheets 0 March 31st, 2008 10:27 AM
cant get beerhouse Login to work in FireFox br BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 7th, 2006 12:09 AM
CMS doesn't appear to work with Firefox 1.5 abel714 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 September 18th, 2006 10:45 AM
code in CH11 not work in FireFox din BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 2 January 18th, 2006 09:21 PM
onMouseOver does not work in FireFox crmpicco Javascript 23 November 9th, 2005 11:15 AM



All times are GMT -4. The time now is 06:19 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.