473,473 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Visible form while click o n a link

99 New Member
HI guys,
I have a index.php page. This page contain two div. I m giving the code below:
[HTML]
<div id="v_div">
You must login to access the pages <a href="#" onclick="visible_form()">Sign In</a>
</div>
<div id="form" style="visibility:hidden">
<form name="login" method="post" action="login.php">
<table width="50%" class="table1">
<tr>
<td align="left" class="td1">User Name:</td>
<td align="left" class="td2">
<input type="text" size="15" name="username" class="text" />
</td>
</tr>
<tr>
<td class="td1">Password</td>
<td class="td2">
<input type="password" class="text" size="15" />
</td>
</tr>
<tr>
<td class="td1">Login Type:</td>
<td class="td2">
<select name="logintype">
<option value="Admin">Admin</option>
<option value="User">User</option>
<option value="Other">Other</option>
</select>
</td>
</tr>
<tr>
<td></td>
<td class="td2"><input type="button" value="login" />
</tr>
</table>
</form>
</div>
[/HTML]

now what i want is that when i click on the link Sign In, the below form should be visible. I try myself with the code given below
[HTML]
<script>
function visible_form()
{
document.getElementById("form").innerHTML = visible;
}
</script>
[/HTML]
but unfortuantely its not working. plz help me .. thanks in advance
Feb 11 '08 #1
1 1584
harshmaul
490 Recognized Expert Contributor
Hi mate...
This should've been for the javascript forums, but next time yeah...

but heres the markup fixed a little...

you were using "innerhtml" this is what we use to change the content of an element....

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script>
  4. function visible_form()
  5. {
  6. document.getElementById("form").style.visibility = 'visible';
  7. }
  8. </script>
  9.  
  10. </head>
  11. <body>
  12. <div id="v_div">
  13. You must login to access the pages <a href="#" onclick="visible_form()">Sign In</a>
  14. </div>
  15. <div id="form" style="visibility:hidden;">
  16. <form name="login" method="post" action="login.php">
  17.                 <table width="50%" class="table1">
  18.                     <tr>
  19.                         <td align="left" class="td1">User Name:</td>
  20.                         <td align="left" class="td2">
  21.                             <input type="text" size="15" name="username" class="text" />
  22.                         </td>
  23.                     </tr>
  24.                     <tr>
  25.                         <td class="td1">Password</td>
  26.                         <td class="td2">
  27.                             <input type="password" class="text" size="15" />
  28.                         </td>
  29.                     </tr>
  30.                     <tr>
  31.                         <td class="td1">Login Type:</td>
  32.                         <td class="td2">
  33.                             <select name="logintype">
  34.                                 <option value="Admin">Admin</option>
  35.                                 <option value="User">User</option>
  36.                                 <option value="Other">Other</option>
  37.                             </select>
  38.                         </td>
  39.                     </tr>
  40.                     <tr>
  41.                         <td></td>
  42.                         <td class="td2"><input type="button" value="login" />
  43.                     </tr>
  44.                 </table>                    
  45.             </form>
  46. </div>
  47. </body>
  48. </html>
Feb 11 '08 #2

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

Similar topics

5
by: lawrence | last post by:
Here is a script that is suppose to turn the DIV tag "optionalDiv" visible on click. This works fine on a PC (IE and Netscape both I think) but not on a Mac. Why? <script...
0
by: Eric J Owens | last post by:
Thanks and Hello to you! I have a form in A2k that has a tab control on it. The form opens the first page and filters the records I want just fine. When I click a tab, to view another set of...
3
by: Susan Bricker | last post by:
Greetings. I have three forms that are open at the same time. They are related and cascading. The first form (frmEventAdd) is the anchor. Each event can have many Trials. The second form is...
5
by: DraguVaso | last post by:
Hi, I have a MDIForm with some MDIChilds. When the user clicks on the "x" in the upper right corner, I don't want the MDIChild to be closed, but the property Visible = False. So far no...
16
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images,...
5
by: Lucvdv | last post by:
Can anyone explain why this happens with the code at the bottom? It looked like a thread safety issue, but changing the declaration of Label1 to Shared doesn't help. Standard windows form;...
1
by: tony | last post by:
Hello!! I have an application that consist of several windows forms. Lets call these A,B and C for simplicity. I have one main meny where the user can choose window form A or B or C. When a...
1
by: Geoffrey | last post by:
Hello, On a form, I place a buton with an OnClick event. No problem. I set the visible propperty of this button to false. And reset it so true again, the event isn't fired ans my app same to...
8
by: Dan | last post by:
Hi, i experimented with postback and viewstate. With this code, there are 2 dropdownlists created, one visible and with AutoPostBack true, the other not visible and no AutoPostBack, and one...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.