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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox

Status
Not open for further replies.

zxcdf5je

Programmer
Apr 1, 2005
86
US
hi there!

want to place a checkbox in the div which is overlaping other elements.when the div is closed then the user sees other table elements.i want to place a check box in this div section.this checkbox will be used for :
"dont show me this window again" purpose.
any ideas how i can do it?
 
Since you've not supplied any code that shows how you invoke the popup box, it's hard to tell you what to change to make a control to suppress the popup box.

However, this is how you would need to go about it. When the close button is clicked for the div, examine the .checked property of the checkbox. If it is true then set a cookie on the machine to indicate that the user is not interested in seeing the dialog box anymore. If you've never used cookies before then look them up in google, they're not complicated. In the code that you invoke to popup the help box, put a check the searches for the existence of the box suppression cookie. If it exists, do not show the window.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
kaht:
this is my script:

<script type="text/javascript">

function hideDiv(obj) {
obj.style.display = "none"
}

</script>
<style type="text/css">

#divId{
position: absolute;
background:#EEEEEE;
width:500px;
height:300px;
top: 240px;
left: 470px;
z-index:99;
display:block;

}


</style>

<div id="divId"><b><br /><br />
POs don't always have<br /><br /><br />
shipping locations and proper address is crucial.<br /><br /><br /></b>

<a href="#" onclick="return hideDiv(document.getElementById('divId'))">CLOSE THIS WINDOW</a><br /><br /><br /><br /><br />
Dont show this window again
<input type="checkbox" name"check" >
</div>
<table>
....
</table>
<table>
...
</table>
 
zxcdf5je, I have told you the appropriate steps to take to finish your problem. Make an attempt to follow those steps and if you get stuck post back with what problems you encounter.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
sure thanks.i thought you wanted to see my code too.Thanks!
 
kaht:

need your help in this.this is the fucntion for the cookie and i dont know how i shud tell in the else loop to show the div or not:

function setcookie(cookieName,cookieValue,nDays) {
var today = new Date();
var expire = new Date();
if (nDays==null ¦¦ nDays==0) nDays=1;
expire.setTime(today.getTime() + 3600000*24*nDays);
document.cookie = cookieName+"="+escape(cookieValue)
+ ";expires="+expire.toGMTString();
}
if (document.form.check1.checked="true"){
setCookie(tempcookie,5,10);
dont show the div again???
}
else{
show the div again???
}


any idea?
 
In the [!]code that you invoke to popup the help box[/!], put a check the searches for the existence of the box suppression cookie. [!]If it exists, do not show the window.[/!]

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
i am not using the pop up concept here.i have the div which shows up on the other layers and when you click "close" it closes and therefore the other layers are then shown.
 
[!]i have the div which shows up on the other layers[/!] and when you click "close" it closes and therefore the other layers are then shown.

What makes it show up on the other layers? Is there javascript that makes the div show up? Is it just built into the page with the rest of the content? Are you using a server-side language to serve the page (ASP, PHP, JSP, etc)? Whatever makes that div appear in the first place is what you need to target. That way you can make it NOT appear if the cookie exists.

If the div is just served with the rest of the page content then you can use your server side language to store the cookie and determine whether or not the div gets served with the rest of the page. If this is the case, then you need to post any further inquiries about this issue in the appropriate server side language forum because it is outside the realm of client-side javascript.

I'm sorry, but I do not think my suggestions are "sinking in" - so I wish you good luck finding a solution.

-kaht

Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B> bites again.[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top