Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 02-13-2006, 11:58 PM   #1 (permalink)
vaidhiswaran
Registered User
 
Join Date: Feb 2006
Posts: 2
vaidhiswaran is on a distinguished road
User Defined Dialog Box in Javascript

Hello ,

Can any one tell me how to create a user defined Dialog box with any no of options or buttons for the user to choose from (Yes/No/Cancel/Submit../..).
Should be a javascript.Can be a javascript function.

Thanks,
Vaidhi
vaidhiswaran is offline   Reply With Quote
Old 02-14-2006, 12:15 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
I don't know that you can do that. You might want to look into making a hidden div which you can toggle the visibility attribute on.

here's code that does what i'm talking about, except you would have to work on making your div look like the dialog box you want.
HTML Code:
<html>
<head>
	<title>Toggle Div</title>
<style>
#mydiv {
	background-color: #CCCCCC;
	border: 1px solid #000000;
  width: 200px;
  height: 100px;
  visibility: hidden;
  position: absolute;
  left: 150px;
  top: 50px;
}
</style>

<script>
function toggleDiv() {
	var o = document.getElementById("mydiv");
	o.style.visibility = o.style.visibility=="visible" ? "hidden" : "visible";
	return false;
}
</script>
</head>
<body>
<div id="mydiv">&nbsp;</div>

<a href="#" onclick="return toggleDiv();">Toggle Div</a>
</body>
</html>
i could be wrong though. you may want to search on the regular javascript dialog box thing, but i've never seen one.
sde is offline   Reply With Quote
Old 02-14-2006, 12:40 AM   #3 (permalink)
vaidhiswaran
Registered User
 
Join Date: Feb 2006
Posts: 2
vaidhiswaran is on a distinguished road
Hi Sde,

I tried your code looks great, But Iam searching for a Javascript dialog box with alert buttons like(Yes/No/Cancel..).User should be able to define the options.

Thanks,
Vaidhi
vaidhiswaran is offline   Reply With Quote
Old 02-14-2006, 12:51 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
if you find one, post back here to let me know. i don't think browsers support that like windows form programming does though.

when you say 'user', do you mean the html programmer? or the person using your web page? i suppose it doesn't matter since i don't have any other answer for ya .. good luck.
sde is offline   Reply With Quote
Reply

Bookmarks

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with copying backwards rogue Standard C, C++ 9 04-24-2005 04:39 PM
what language is this? sde All Other Coding Languages 10 05-25-2004 03:57 PM
Javascript Function jcramer83 HTML, XML, Javascript, AJAX 5 04-14-2003 06:12 AM


All times are GMT -8. The time now is 10:34 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting