Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 29th, 2007, 12:13 PM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Div problems (javaScript)

Hello,

I have a function to display small divs next to each field that failed my validation tests. And I have a larger one that floats on top of the form saying error... the user can click a button to hide that large error message div, but for some reason when they do so, it re-loads the page and the other divs are also hidden...

The div:
 <div id="err_div" style=" left: 177px; width: 292px; position:relative; top: -472px; background-color: White; height: 131px; visibility:hidden; border-style:dashed;  border-width: thin; border-color: Black; visibility:hidden; ">
     
               <div style="padding-left: 5px; background-image:url(/resources/div_bg.gif); border-bottom-style:solid; border-bottom-width:thin; border-bottom-color: Black; ">
                <font face="arial" size="4" color="black"> Error !</font>
                </div>
                
                <div style=" padding:5px;" >
                   <font face="verdana" size="2" color="black"> <br />Sorry, some fileds were not filled in.</font>    

<asp:Button ID="Button1" runat="server" Text="Ok" BackColor="Gray" BorderStyle="None" CausesValidation="False" ForeColor="White" Width="35px" onclientclick="hideAgain('err_div')" />
</div>
           </div>

The Code:
function hideAgain(divName)
    {
       var the_div = document.getElementById(divName);
       the_div.style.visibility="hidden";
    }
paulchwd is offline   Reply With Quote
Old Nov 1st, 2007, 8:36 PM   #2
fahlyn
Newbie
 
Join Date: Nov 2007
Posts: 15
Rep Power: 0 fahlyn is on a distinguished road
Re: Div problems (javaScript)

I think your javascript function may need to "return false".
fahlyn is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Start Learning Java script smita JavaScript and Client-Side Browser Scripting 0 Mar 15th, 2007 7:47 AM
Hidden unless Javascript enabled? Writlaus JavaScript and Client-Side Browser Scripting 3 Apr 25th, 2006 10:52 PM
Javascript alternative? Writlaus JavaScript and Client-Side Browser Scripting 32 Apr 21st, 2006 12:44 AM
HTML page not reading external Javascript file aznluvsmc JavaScript and Client-Side Browser Scripting 9 Nov 21st, 2005 9:17 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:51 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC