By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,948 Members | 1,559 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,948 IT Pros & Developers. It's quick & easy.

How to use div

P: 5
Hi everybody,
In my web page i have a EDIT button, when the user click on the edit button,
I want to display a small window in which I want to enter the details which are to be edited.
How could it be possible?
Feb 16 '09 #1
Share this Question
Share on Google+
5 Replies

Expert 5K+
P: 6,050
-- Moved from PHP.

PHP will not help you show a div. Anyway, is your data coming from a database?
Feb 16 '09 #2

P: 5
Hi markus, thanx for replaying.
No my data is not coming from database, and ok if php dont have div, so can I use another coding in my php page for div.
when we click on the login hyperlink on this website, then a small window is generated, which asks us username and password.
thats all I want to do some thing like that.
please help me.
Feb 16 '09 #3

Expert Mod 15k+
P: 16,027
You can put the div within the page and keep it hidden:
Expand|Select|Wrap|Line Numbers
  1. <div id="login" style="display:none">
then when it's ready to be shown:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("login").style.display = "block";
Feb 16 '09 #4

P: 5
have u got what m I want to display?
Just look at the small window came when we click on the login hyperlink on this website only.
And if do you have a code for it please send me.
Feb 17 '09 #5

Expert Mod 15k+
P: 16,027
The code is simple enough. View the source to see it:
Expand|Select|Wrap|Line Numbers
  1. <div style="display: none;" id="login_menu"> some content </div>
where "some content" is the HTML for the login form.

Now, you need a trigger to show this hidden div. Either use a link or a button. In the onclick, call a function to show the div. You could use a general function:
Expand|Select|Wrap|Line Numbers
  1. function showDiv(id) {
  2.     document.getElementById(id).style.display = "block";
  3. }
which is called as follows:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" id="showLogin" value="Login" onclick="showDiv('login_menu');">
Feb 17 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.