Solved

Need help on HTML5 Form

Posted on 2014-01-29
8
365 Views
Last Modified: 2014-01-30
Hi Experts,

I am newbie to web design and need help on designing a page using HTML5 .I have attached a form to this question and need sample working code for this using HTML5 with similar alignment and layout (Please see comments in the attached screenshot)

Thanks in Advance
html5form.png
0
Comment
Question by:ksd123
  • 4
  • 4
8 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39817207
Let me know if you need help understanding this.    

http://jsbin.com/padasQ_28350882/1/edit?html,output

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
  </style>
</head>
<body>
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  
  
</body>
</html>

Open in new window

0
 

Author Comment

by:ksd123
ID: 39817318
Thank you for the quick turn around.

I was told not to use bootstrap  so I need above code without using bootstrap classes.

The other important thing I was told is the page layout should not be  responsive design ie.when I minimize/maximize the page  the textboxes / dropdowns / rounded tables etc. width /height should not shrink /grow with the screen size they all should have  fixed size.  

Thanks once again.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39817347
Bootstrap is not used here.  Just change the width's from % to px if you want it fixed.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:ksd123
ID: 39817378
I am still confused .What are these classes row box rounded,col-sm,col-lg,row in Div's? where we have defined these classes? and also when I change the widht from % to px the page layout is messed up and not looking  good.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39817407
I will make it easier, just wrap a container that is fixed

The container sets the width to 900px.  Make this whatever you want.
By making the label a block and floating it left, it will be similar to using div's and the label will be to the left of the input.

The row sets off another block and we give it a bit of a margin at the bottom to space things out.
the box class creates the border and we add some padding on the inside
the rounded class makes the corners round
the col_sm is similar to bootstrap but not the same (col_sm_12) and I simply made it 30% and floated left.
col_lg is 60 % and floating the 2 divs inside a block (row) creates the 2 columns.

Sample http://jsbin.com/padasQ_28350882/2/
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   .container{width:900px;}
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
  </style>
</head>
<body>
  <div class="container">
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  </div>
  
</body>
</html>

Open in new window

0
 

Author Comment

by:ksd123
ID: 39817508
Thank you so much. Just  I want the (Activity) dropdown width to be equal with (Name) textbox width.Now the dropdown width is very small compared to textbox width.
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39818062
http://jsbin.com/padasQ_28350882/3/

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
 <style>
   .container{width:900px;}
label{display:block;width:30%;float:left;}
.row{margin-bottom:10px;}
.box{border-color:black;border-style:solid;padding-left:20px;padding-right:20px;padding-top:5px;padding-bottom:20px;overflow: hidden;}
.rounded{border-radius:15px;}
h2{font-size:90%;margin-top:1%}
.col_sm{width:30%;float:left;}
.col_lg{width:60%;;float:left;}
   input{width:75px;}
   select{width:80px;}
  </style>
</head>
<body>
  <div class="container">
  <form>
    <div class="row">
      <label for "activity">Activity</label>
      <select id="activity" name="activity">
        <option value="1">One</option>
        <option value="2">two</option>
        <option value="3">three</option>
      </select>
      
    </div>
      <div class="row">
        <label for "name">Name</label>
        <input id="name" name="name">
      </div>
    
  </form>
  <div class="row box rounded">
    <h2>Project Status</h2>
     <div class="col_sm">Proj1</div>
    <div class="col_lg">Proj data</div>  
    <div class="col_sm">Proj2</div>
    <div class="col_lg">Proj data</div> 
  </div>
  <div class="row box rounded">
    <h2>Subject Status</h2>
    <div class="col_sm">subj1</div>
    <div class="col_lg">subj datasubj datasubj datasubj datasubj datasubj datasubj data</div>  
    <div class="col_sm">subj2</div>
    <div class="col_lg">subj data</div> 
  </div>
  </div>
  
</body>
</html>

Open in new window

I would suggest spending a few hours on html and css basics if you are going to do this on a regular basis.  It will save you  a ton of time and headeachs down the road.  http://www.codecademy.com/learn
0
 

Author Closing Comment

by:ksd123
ID: 39820385
Thank you
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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 …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

808 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