Solved

Two Forms Side By Side in one div

Posted on 2014-11-12
6
342 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Add box and text color changing for everything 1 26
Jquery keyup 4 19
where is team.js? 3 26
styling bootstrap grid system with CSS 2 6
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.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

777 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