Solved

Need help on HTML5 Form

Posted on 2014-01-29
8
364 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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 …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

816 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

14 Experts available now in Live!

Get 1:1 Help Now