Solved

Two Forms Side By Side in one div

Posted on 2014-11-12
6
316 Views
Last Modified: 2014-11-13
I have a div with a form in it.  I want to place a second form in the div on the right of the first form.  How do I do this?  Right now they are lined up vertically.  I want both inside one div side by side.
The Javascript
//Function To Display Popup
function div_show() {
document.getElementById('abc').style.display = "block";
}
//Function to Hide Popup
function div_hide(){
document.getElementById('abc').style.display = "none";
}

Open in new window


The Div
<div id="abcd">    
<!-- Popup Div Starts Here -->
<div id="popupLog">
<form action="#" id="form" method="post" name="form">
<img id="close" src="images/3.png" onclick ="div_hide()">
<h2>Join Mediascrubber</h2>
<hr>
<input id="firstname" name="firstname" placeholder="First Name" type="text">
<input id="lastname" name="lastname" placeholder="Last Name" type="text">
<input id="username" name="username" placeholder="User Name" type="text">
<input id="password" name="password" placeholder="Password" type="text">
<input id="email" name="email" placeholder="Email" type="text">
&nbsp;
<!--textarea id="msg" name="message" placeholder="Message"></textarea-->
<a href="javascript:%20check_empty()" id="submit">Send</a>
</form>



<form action="#" id="form" method="post" name="form">
<img id="close" src="images/3.png" onclick ="div_hide()">
<h2>Log In</h2>
<hr>
<input id="username" name="username" placeholder="User Name" type="text">
<input id="password" name="password" placeholder="Password" type="text">
&nbsp;
<!--textarea id="msg" name="message" placeholder="Message"></textarea-->
<a href="javascript:%20check_empty()" id="submit">Send</a>
</form>
<!-- Popup Div Ends Here -->
</div>
</div>

Open in new window

0
Comment
Question by:DS928
  • 3
  • 3
6 Comments
 
LVL 21

Accepted Solution

by:
ivanoviola earned 500 total points
ID: 40439060
Does this work for you?

IV
<div id="abcd">
  <!-- Popup Div Starts Here -->
  <div id="popupLog">
  <table width="547" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="381">
    <form action="#" id="form" method="post" name="form">
<img id="close" src="images/3.png" onclick ="div_hide()">
<h2>Join Mediascrubber</h2>
<hr>
<input id="firstname" name="firstname" placeholder="First Name" type="text">
<input id="lastname" name="lastname" placeholder="Last Name" type="text">
<input id="username" name="username" placeholder="User Name" type="text">
<input id="password" name="password" placeholder="Password" type="text">
<input id="email" name="email" placeholder="Email" type="text">
&nbsp;
<!--textarea id="msg" name="message" placeholder="Message"></textarea-->
<a href="javascript:%20check_empty()" id="submit">Send</a>
</form>
    </td>
    <td width="166">
    <form action="#" id="form" method="post" name="form">
<img id="close" src="images/3.png" onclick ="div_hide()">
<h2>Log In</h2>
<hr>
<input id="username" name="username" placeholder="User Name" type="text">
<input id="password" name="password" placeholder="Password" type="text">
&nbsp;
<!--textarea id="msg" name="message" placeholder="Message"></textarea-->
<a href="javascript:%20check_empty()" id="submit">Send</a>
</form>
    </td>
  </tr>
</table>
<!-- Popup Div Ends Here -->
</div>
</div>

Open in new window

0
 

Author Comment

by:DS928
ID: 40439079
Close!  I need them to be in the same Div with a white background as opposed to being in separate divs.
The link...
http://www.davidschure.com/member.html#
0
 
LVL 21

Expert Comment

by:ivanoviola
ID: 40439093
Just to confirm...
The two forms should be in one box with the white background?

At the moment the forms are in the <div id="abcd"> and  <div id="popupLog"> divs. They are separated using a table.

IV
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:DS928
ID: 40439153
Yes one div with a white background.
0
 
LVL 21

Expert Comment

by:ivanoviola
ID: 40440143
I see you separated the two forms. Looks good.......are you all set?

IV
0
 

Author Comment

by:DS928
ID: 40440185
Yes Thank You!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now