I making a jsp which ncludes 5 jsp's all together. On my 4th one..it's operational but.. my design looks a lil clunky. Can you point out any suggestions to make it look better or cleaner? Any suggestions would be appreciated. Thanks
CSS
table.det
{ }
table.det td
{
border: none;
}
fieldset.det
{
display:block;
float:left;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:12px;
margin-top:20px;
margin-left:20px;
border:2px solid #CCCCCC;
}
fieldset.det legend
{
padding:2px 5px;
border:2px solid #CCCCCC;
}
jsp:
<tr>
<th>
<span onclick="toggleDiv('filtering', 'filterImg')" style="cursor: hand;">Filters <img name="filterImg" src="../images/minus.gif" /></span>
</th>
</tr>
<tr>
<td>
<div id="filtering" style="display:block;">
<table class ="det">
<tr>
<td>
Workload Year: <select size="1" name="wYearSelect">
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option selected value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
</select>
Fiscal Year: <select size="1" name="wYearSelect">
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option selected value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
</select>
Condition Code: <select size="1" name="condCodeSelect">
<option selected value=""> </option>
<option value="2007">A</option>
<option value="2008">B</option>
<option value="2009">C</option>
<option value="2010">D</option>
<option value="2011">E</option>
<option value="2012">F</option>
<option value="2013">G</option>
<option value="2014">H</option>
</select>
Customer: <select size="1" name="customerSelect">
<option selected value=""> </option>
</select>
Repair Facility: <select size="1" name="repFacSelect">
<option selected value=""> </option>
</select><br/>
Work Type: <select size="1" name="workTypeSelect">
<option selected value=""> </option>
<option value="10">Rebuild</option>
<option value="11">IROAN</option>
<option value="12">SOAR</option>
<option value="13">Special</option>
</select>
Special Indicator: <select size="1" name="specIndSelect">
<option selected value=""> </option>
<option value="RST">RESET</option>
</select>
WBS: <select size="1" name="wbsSelect">
<option selected value=""> </option>
<!-- etc -->
</select>
<br/>
Appropriation: <select size="1" name="appropSelect">
<option selected value=""> </option>
</select>
MWSLIN: <input type="text" name="mwslin" value=""/>
Serial #: <input type="text" name="mwslin" value=""/>
<input type="checkbox" name="include_carryover">Include Carryover</input>
</td></tr><tr><td>
<fieldset>
<legend>Standard Materiel filter structure here</legend>
NSN: <input type="text" name="nsn" value=""/>
TAMCN: <input type="text" name="tamcn" value=""/>
PGD/Group: <input type="text" name="pgd" value=""/>
SAC : <select size="1" name="condCodeSelect">
<option selected value=""> </option>
<option value="2011">1</option>
<option value="2012">2</option>
<option value="2013">3</option>
</select>
<br/>
Nomenclature: <input type="text" name="nomen" value=""/>
</fieldset>
</td></tr><tr><td>
<fieldset class="det">
<legend>Source of Repair</legend>
<input type="checkbox" name="sorCodes" value="A">MCA </input>
</fieldset>
<fieldset class="det">
<legend>Schedule Type</legend>
<input type="checkbox" name="schedType" value="1">Regular</input><br/>
<input type="checkbox" name="schedType" value="2">Lot Job</input><br/>
<input type="checkbox" name="schedType" value="3">Batch Job</input>
</fieldset>
<fieldset class="det">
<legend>Workload Type</legend>
<input type="checkbox" name="workloadType" value="1">SMC Workload</input><br/>
<input type="checkbox" name="workloadType" value="2">Other Workload</input>
</fieldset>
<fieldset class="det">
<legend>Closure Level</legend>
<input type="checkbox" name="workloadType" checked value="1">Open</input><br/>
<input type="checkbox" name="workloadType" value="1">Physically Complete</input><br/>
<input type="checkbox" name="workloadType" value="2">Financially Complete</input>
</fieldset>
</td></tr></table>
</div>
</td>
</tr>
<tr>
<td align="center">
<button name="Generate Report" value="Generate Report">Generate Report</button>
<button name="Clear Criteria" value="Clear Criteria">Clear Criteria</button>
</td>
</tr>
At a first glance, getting rid of the tables would be somewhere to start if you can.
I am headed to work will look over it more thoroughly there.
Cheers!
EDIT - You could take out the border on your fieldset.det legend, it should cascade down from fieldset.det
On your div id=filtering, couldn't you add the extra styling to the filtering id?
EDIT - Here is something I threw together, not saying it is ANYWHERE near perfect. It gives you a div layout and ways to easily change the layout through CSS. Also, check out this site for best form practices, http://blog.sherpawebstudios.com/2009/06/17/top-10-html-form-layout-best-practices/.
CSS:
#wrapper{ width: 1040; overflow:hidden; }
#filter {
cursor: hand;
font-size: 20px;
font-weight: bold;
margin-bottom: 10px;
}
.formLabel {
font-weight: bold;
text-align: right;
width: 160px;
float: left;
}
.field {
float: left;
}
.content:before,
.content:after {
content: "";
display:table;
}
.content:after {
clear: both;
}
/*IE 6/7 */
.content { zoom:1;margin-bottom: 10px;}
.subset {
float: left;
margin: 0 15;
}
.subset div.formLabel {
width:100px;
}
#generate {
margin-right:15px;
}
HTML:
<div id = "wrapper" >
<div id = "filter" class ="clearfix">
<span onclick="toggleDiv('filtering', 'filterImg')">Filters <img name="filterImg" src="../images/minus.gif" /></span>
</div>
<div class = "content">
<div class = "formLabel">
Workload Year:
</div>
<div class = "field">
<select size="1" name="wYearSelect">
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option selected value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Fiscal Year:
</div>
<div class = "field">
<select size="1" name="wYearSelect">
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
<option selected value="2012">2012</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Condition Code:
</div>
<div class = "field">
<select size="1" name="condCodeSelect">
<option selected value=""> </option>
<option value="2007">A</option>
<option value="2008">B</option>
<option value="2009">C</option>
<option value="2010">D</option>
<option value="2011">E</option>
<option value="2012">F</option>
<option value="2013">G</option>
<option value="2014">H</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Customer:
</div>
<div class = "field">
<select size="1" name="customerSelect">
<option selected value=""> </option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Repair Facility:
</div>
<div class = "field">
<select size="1" name="repFacSelect">
<option selected value=""> </option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Work Type:
</div>
<div class = "field">
<select size="1" name="workTypeSelect">
<option selected value=""> </option>
<option value="10">Rebuild</option>
<option value="11">IROAN</option>
<option value="12">SOAR</option>
<option value="13">Special</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Special Indicator:
</div>
<div class = "field">
<select size="1" name="specIndSelect">
<option selected value=""> </option>
<option value="RST">RESET</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
WBS:
</div>
<div class = "field">
<select size="1" name="wbsSelect">
<option selected value=""> </option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Appropriation:
</div>
<div class = "field">
<select size="1" name="appropSelect">
<option selected value=""> </option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
MWSLIN:
</div>
<div class = "field">
<input type="text" name="mwslin" value=""/>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Serial #:
</div>
<div class = "field">
<input type="text" name="mwslin" value=""/>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Include Carryover:
</div>
<div class = "field">
<input type="checkbox" name="include_carryover"></input>
</div>
</div>
<div class ="content">
<div class = "subset">
<h3>Standard Material filter structure here</h3>
<div class = "content">
<div class = "formLabel">
NSN:
</div>
<div class = "field">
<input type="text" name="nsn" value=""/>
</div>
</div>
<div class = "content">
<div class = "formLabel">
TAMCN:
</div>
<div class = "field">
<input type="text" name="tamcn" value=""/>
</div>
</div>
<div class = "content">
<div class = "formLabel">
PGD/Group:
</div>
<div class = "field">
<input type="text" name="pgd" value=""/>
</div>
</div>
<div class = "content">
<div class = "formLabel">
SAC :
</div>
<div class = "field">
<select size="1" name="condCodeSelect">
<option selected value=""> </option>
<option value="2011">1</option>
<option value="2012">2</option>
<option value="2013">3</option>
</select>
</div>
</div>
<div class = "content">
<div class = "formLabel">
Nomenclature:
</div>
<div class = "field">
<input type="text" name="nomen" value=""/>
</div>
</div>
</div>
<div class = "subset">
<h3>Source of Repair</h3>
<div class = "formLabel">
MCA
</div>
<input type="checkbox" name="sorCodes" value="A"></input>
</div>
<div class = "subset">
<h3>Schedule Type</h3>
<div class = "formLabel">
Regular
</div>
<input type="checkbox" name="schedType" value="1"></input><br/>
<div class = "formLabel">
Lot Job
</div>
<input type="checkbox" name="schedType" value="2"></input><br/>
<div class = "formLabel">
Batch Job
</div>
<input type="checkbox" name="schedType" value="3"></input>
</div>
<div class = "subset">
<h3>Workload Type</h3>
<div class = "formLabel">
SMC Workload
</div>
<input type="checkbox" name="workloadType" value="1"></input><br/>
<div class = "formLabel">
Other Workload
</div>
<input type="checkbox" name="workloadType" value="2"></input>
</div>
<div class = "subset">
<h3>Closure Level</h3>
<div class = "formLabel">
Open
</div>
<input type="checkbox" name="workloadType" checked value="1"></input><br/>
<div class = "formLabel">
Physically Complete
</div>
<input type="checkbox" name="workloadType" value="1"></input><br/>
<div class = "formLabel">
Financially Complete
</div>
<input type="checkbox" name="workloadType" value="2"></input>
</div>
</div>
<button name="Generate Report" value="Generate Report" id="Generate">Generate Report</button>
<button name="Clear Criteria" value="Clear Criteria">Clear Criteria</button>
Related
I am new to HTML and I am wondering how do I convert the form inputs into a table?
I created a display button, so that when I click on it, the information submitted by a user will be displayed in a table.
<html>
<style>
</style>
<body>
<p> Please insert the following information for your Gym Membership.</p>
<form>
<br>
<label for="name">Name:</label>
<input type="text" id="name">
<br><br>
<label for="age">Age (between 18-60):</label>
<input type="number" id="age" min="18" max="60"><br><br>
<label for="cars">Select your height (feet and inches):</label>
<select id="feet">
<option value="4">4'</option>
<option value="5">5'</option>
<option value="6">6'</option>
</select>
<select id="inches">
<option value="1">1"</option>
<option value="2">2"</option>
<option value="3">3"</option>
<option value="4">4"</option>
<option value="5">5"</option>
<option value="6">6"</option>
<option value="7">7"</option>
<option value="8">8"</option>
<option value="9">9"</option>
<option value="10">10"</option>
<option value="11">11"</option>
</select>
<br>
<br>
<input type="reset" value="Reset">
<input type="submit" value="Display">
</form>
</body>
</html>
It's mandatory to add some javascript to it.
Since you're new to HTML/javascript, I modified your snippet of code to meet your needs.
HTML :
<html>
<style>
</style>
<b>
<p> Please insert the following information for your Gym Membership.</p>
<form action="#" method="post" name="form_name" id="form_id" class="form_class" >
<br>
<label for="name">Name:</label>
<input type="text" id="name">
<br><br>
<label for="age">Age (between 18-60):</label>
<input type="number" id="age" min="18" max="60"><br><br>
<label for="cars">Select your height (feet and inches):</label>
<select id="feet">
<option value="4">4'</option>
<option value="5">5'</option>
<option value="6">6'</option>
</select>
<select id="inches">
<option value="1">1"</option>
<option value="2">2"</option>
<option value="3">3"</option>
<option value="4">4"</option>
<option value="5">5"</option>
<option value="6">6"</option>
<option value="7">7"</option>
<option value="8">8"</option>
<option value="9">9"</option>
<option value="10">10"</option>
<option value="11">11"</option>
</select>
<br>
<br>
<input type="reset" value="Reset">
<input type="button" Value="submit" onclick="Display()">
</form>
</b>
</html>
<div id="table" style="display:none;" class="answer_list" > <table id="myTable">
</table></div>
Javascript :
function Display()
{
document.getElementById('table').style.display = "block";
var table = document.getElementById("myTable");
var row = table.insertRow(0);
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
var cell3 = row.insertCell(2);
cell1.innerHTML = document.getElementById("name").value;
cell2.innerHTML = document.getElementById("age").value;
cell3.innerHTML = document.getElementById("feet").value+"," +document.getElementById("inches").value;
}
or you can find it in the link below, it works fine :
https://codepen.io/iliass-coder/pen/jOPBbdz
Take some time to read it and understand what I did. and try to add some CSS, it's a bit ugly for the moment.
I am using bootstrap, I wanted to know is there something like a feature in bootstrap to do this?
<div class="form-group">
<label class="col-sm-6 control-label" for="textinput">Flooring material </label>
<div class="col-sm-6">
<select class="form-control" name="flooring_meterial">
<option value="0">-Select-</option>
<option value="1" >Earth,sand</option>
<option value="2">Dung</option>
<option value="3">Wood/planks</option>
<option value="4">Parquet or polished wood</option>
<option value="5">other</option>
</select>
<input type="text" placeholder="Other" class="form-control" name="f_m_other">
</div>
</div>
I want to activate this bellow input field, if the above select field value is "other"
Since I could not able to find a short cut for this using bootstrap, I thought to write this in native javascript.
function disable(select_val,input_id) {
var e = document.getElementById(select_val);
var strUser = e.options[e.selectedIndex].value;
if(strUser === "100"){
document.getElementById(input_id).disabled = false;
}
else{
document.getElementById(input_id).value = document.getElementById(input_id).defaultValue;
document.getElementById(input_id).disabled = true;
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="form-group">
<label class="col-sm-6 control-label" for="textinput">Principle mode of water supply</label>
<div class="col-sm-6">
<select class="form-control" name="water_supply" id="water_supply" onchange="disable('water_supply', 'w_s_other')">
<option value="0">-Select-</option>
<option value="1">Shared/ public well</option>
<option value="4">Private pipe line</option>
<option value="5">Stream/river</option>
<option value="100" >Other</option>
</select>
<input type="text" placeholder="Other" class="form-control" name="w_s_other" id="w_s_other" disabled value="">
</div>
</div>
<div class="form-group">
<label class="col-sm-6 control-label" for="textinput">x2</label>
<div class="col-sm-6">
<select class="form-control" name="water_supply" id="x2" onchange="disable('x2', 'x2other')">
<option value="0">-Select-</option>
<option value="1">Shared/ public well</option>
<option value="5">Stream/river</option>
<option value="100" >Other</option>
</select>
<input type="text" placeholder="Other" class="form-control" name="w_s_other" id="x2other" disabled value="">
</div>
</div>
Try using change event at select element to set input disabled to true if value of select element is "5" with .prop()
$("select").change(function() {
$("+ input", this).prop("disabled", !(this.value === "5"))
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js">
</script>
<div class="form-group">
<label class="col-sm-6 control-label" for="textinput">Flooring material </label>
<div class="col-sm-6">
<select class="form-control" name="flooring_meterial">
<option value="0">-Select-</option>
<option value="1" >Earth,sand</option>
<option value="2">Dung</option>
<option value="3">Wood/planks</option>
<option value="4">Parquet or polished wood</option>
<option value="5">other</option>
</select>
<input type="text" placeholder="Other" class="form-control" name="f_m_other" disabled="true">
</div>
</div>
So i'm trying to make the text inside the select form have colors so example where you write your name to send email i want the text is a color black example, Also inside the select form i tried using div but failed to get it to work. I tried putting this in the css also to link it to div also didn't
work.
#skills {
color:F0F8FF;
}
<form name="enq" method="post" action="email/" onsubmit="return validation();">
<fieldset class="contact-inner">
<p class="contact-input">
<input type="text" id="email" value="" name="email" placeholder="Your Email..." autofocus>
<input type="text" id="name" value="" name="name" placeholder="Your Full Name." autofocus>
<input type="text" id="skype" value="" name="skype" placeholder="Your Skype Name." autofocus>
</p>
<div id="skills">
<p class="contact-input">
<label for="select" class="select">
<select name="why" id="why">
<option value="" selected>Skills</option>
<option value="3D Printing">3D Printing</option>
<option value="Alternative Healers">Alternative Healers</option>
<option value="Aquaponics/Hydroponics">Aquaponics/Hydroponics</option>
<option value="Architecture/Design">Architecture/Design</option>
<option value="Cabinetry / Carpentry">Cabinetry / Carpentry</option>
<option value="Construction">Construction</option>
<option value="Culinary Arts">Culinary Arts</option>
<option value="Electrician">Electrician</option>
<option value="EM Technology">EM Technology</option>
<option value="Free Energy/QEG">Free Energy/QEG</option>
<option value="Hair and/or Nail Stylist">Hair and/or Nail Stylist</option>
<option value="Hemp Farming">Hemp Farming</option>
<option value="Hempcrete">Hempcrete</option>
<option value="Kundalini8 Practitioner">Kundalini8 Practitioner</option>
<option value="Landscaping">Landscaping</option>
<option value="Massage Therapist">Massage Therapist</option>
<option value="Qi Gong Practitioners">Qi Gong Practitioners</option>
<option value="Permaculture">Permaculture</option>
<option value="Recycling">Recycling</option>
<option value="Sewing">Sewing</option>
<option value="Tai Chi Practitioner">Tai Chi Practitioner</option>
<option value="Technology">Technology</option>
<option value="Other">Other</option>
<option value="All">All</option>
<option value="None">None</option>
</div>
</select>
<label for="select" class="select">
<select name="participate" id="participate">
<option value="" selected>When can you participate?</option>
<option value="3-6 months from now">3-6 months from now</option>
<option value="6-12 months">6-12 months</option>
<option value="Next Year (2016)">Next Year (2016)</option>
<option value="Don't know yet">Don't know yet</option>
</select>
</label>
</p>
<p class="contact-input">
<textarea rows="11" name="message" id="message" placeholder="Your Message…"></textarea>
</p>
<p class="contact-submit">
<input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
</p>
</fieldset>
</form>
Try using:
-input-placeholder
Is this what you wanted?
::-webkit-input-placeholder { /* WebKit browsers */
color: #000;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: #000;
opacity: 1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #000;
opacity: 1;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #000;
}
<form name="enq" method="post" action="email/" onsubmit="return validation();">
<fieldset class="contact-inner">
<p class="contact-input">
<input type="text" id="email" value="" name="email" placeholder="Your Email..." autofocus />
<input type="text" id="name" value="" name="name" placeholder="Your Full Name." autofocus />
<input type="text" id="skype" value="" name="skype" placeholder="Your Skype Name." autofocus />
</p>
<div id="skills">
<label for="select" class="select"></label>
<select name="why" id="why">
<option value="" selected>Skills</option>
<option value="3D Printing">3D Printing</option>
<option value="Alternative Healers">Alternative Healers</option>
<option value="Aquaponics/Hydroponics">Aquaponics/Hydroponics</option>
<option value="Architecture/Design">Architecture/Design</option>
<option value="Cabinetry / Carpentry">Cabinetry / Carpentry</option>
<option value="Construction">Construction</option>
<option value="Culinary Arts">Culinary Arts</option>
<option value="Electrician">Electrician</option>
<option value="EM Technology">EM Technology</option>
<option value="Free Energy/QEG">Free Energy/QEG</option>
<option value="Hair and/or Nail Stylist">Hair and/or Nail Stylist</option>
<option value="Hemp Farming">Hemp Farming</option>
<option value="Hempcrete">Hempcrete</option>
<option value="Kundalini8 Practitioner">Kundalini8 Practitioner</option>
<option value="Landscaping">Landscaping</option>
<option value="Massage Therapist">Massage Therapist</option>
<option value="Qi Gong Practitioners">Qi Gong Practitioners</option>
<option value="Permaculture">Permaculture</option>
<option value="Recycling">Recycling</option>
<option value="Sewing">Sewing</option>
<option value="Tai Chi Practitioner">Tai Chi Practitioner</option>
<option value="Technology">Technology</option>
<option value="Other">Other</option>
<option value="All">All</option>
<option value="None">None</option>
</select>
<label for="select" class="select"></label>
<select name="participate" id="participate">
<option value="" selected>When can you participate?</option>
<option value="3-6 months from now">3-6 months from now</option>
<option value="6-12 months">6-12 months</option>
<option value="Next Year (2016)">Next Year (2016)</option>
<option value="Don't know yet">Don't know yet</option>
</select>
</div>
</p>
<p class="contact-input">
<textarea rows="11" name="message" id="message" placeholder="Your Message…"></textarea>
</p>
<p class="contact-submit">
<input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
</p>
</fieldset>
</form>
something like this?
#email {
color:blue; /*target element with id email and set text color to blue*/
}
#name {
color: red; /*target element with id name and set text color to red*/
}
#skype {
color: green; /*target element with id skype and set text color to green*/
}
#why {
color: orange; /*target element with id why and set text color to orange. in this case, its a select, so all the text within the select - meaning the options text- is orange*/
}
#participate .yellow {
color: yellow; /*target elements with class yellow (options) inside element id participate (select) and set text color to yellow. in this case, you can select which options to make yellow by adding classes*/
}
#message {
color: purple; /*target element with id message and set text color to purple*/
}
<form name="enq" method="post" action="email/" onsubmit="return validation();">
<fieldset class="contact-inner">
<p class="contact-input">
<input type="text" id="email" value="aaaa" name="email" placeholder="Your Email..." autofocus>
<input type="text" id="name" value="bbbbb" name="name" placeholder="Your Full Name." autofocus>
<input type="text" id="skype" value="cccc" name="skype" placeholder="Your Skype Name." autofocus>
</p>
<div id="skills">
<p class="contact-input">
<label for="select" class="select">
<select name="why" id="why">
<option value="" selected>Skills</option>
<option value="3D Printing">3D Printing</option>
<option value="Alternative Healers">Alternative Healers</option>
<option value="Aquaponics/Hydroponics">Aquaponics/Hydroponics</option>
<option value="Architecture/Design">Architecture/Design</option>
<option value="Cabinetry / Carpentry">Cabinetry / Carpentry</option>
<option value="Construction">Construction</option>
<option value="Culinary Arts">Culinary Arts</option>
<option value="Electrician">Electrician</option>
<option value="EM Technology">EM Technology</option>
<option value="Free Energy/QEG">Free Energy/QEG</option>
<option value="Hair and/or Nail Stylist">Hair and/or Nail Stylist</option>
<option value="Hemp Farming">Hemp Farming</option>
<option value="Hempcrete">Hempcrete</option>
<option value="Kundalini8 Practitioner">Kundalini8 Practitioner</option>
<option value="Landscaping">Landscaping</option>
<option value="Massage Therapist">Massage Therapist</option>
<option value="Qi Gong Practitioners">Qi Gong Practitioners</option>
<option value="Permaculture">Permaculture</option>
<option value="Recycling">Recycling</option>
<option value="Sewing">Sewing</option>
<option value="Tai Chi Practitioner">Tai Chi Practitioner</option>
<option value="Technology">Technology</option>
<option value="Other">Other</option>
<option value="All">All</option>
<option value="None">None</option>
</select>
<label for="select" class="select">
<select name="participate" id="participate">
<option value="" selected>When can you participate?</option>
<option value="3-6 months from now">3-6 months from now</option>
<option class="yellow" value="6-12 months">6-12 months</option>
<option value="Next Year (2016)">Next Year (2016)</option>
<option class="yellow" value="Don't know yet">Don't know yet</option>
</select>
</label>
</label>
</p>
</div>
<p class="contact-input">
<textarea rows="11" name="message" id="message" placeholder="Your Message…">ddddd</textarea>
</p>
<p class="contact-submit">
<input type="submit" value="Send Your Message" name="submit" id="submitButton" class="btn btn-info pull-right" title="Click here to submit your message!" />
</p>
</fieldset>
</form>
i am trying to align html controls next to each other without giving huge space and I try to override the bootstrap .css but no luck.
here is my screen looks like:
I have created JSFiddle and also below is my html code.
JSFIDDLE
<div class="row">
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Rows per page:</label>
<div class="col-xs-4">
<form action="/SystemAdmin" id="form_header_pager" method="post" name=
"form_header_pager">
<select class="form-control" data-val="true" data-val-number=
"The field PageSize must be a number." data-val-required=
"The PageSize field is required." id="PageSize" name=
"PageSizeSelect">
<option selected="selected" value="10">
10
</option>
<option value="25">
25
</option>
<option value="50">
50
</option>
<option value="ALL">
ALL
</option>
</select>
</form>
</div>
</div>
</div>
<div class="col-xs-4">
<div>
<div>
<b>Total records:</b> 0
</div>
</div>
</div>
<div class="col-xs-4">
<div class="form-group1">
<label class="col-xs-5 control-label" for="">Show Records:</label>
<div class="col-xs-7">
<form action="/SystemAdmin" id="form_header_show_records" method="post"
name="form_header_show_records">
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">
Show All Records
</option>
<option value="invalid">
Show Invalid Records
</option>
<option value="valid">
Show Valid Records
</option>
</select>
</form>
</div>
</div>
</div>
</div>
The big spaces within your layout are caused from using the grid column widths. Bootstrap provides inline form element styling and it's recommended to use that instead of the grid columns.
The additional CSS adjustment I had to make was your totals area. Since it didn't have an input or select element, the vertical alignment was slightly off. If you had a row of inputs (as show in Bootstrap's documentation), you wouldn't need any additional CSS here.
You can view this corrected code snippet below. Please note that you must run it in "Full Page" mode to view it correctly. By default the form-inline tool only works in viewports greater than 768px.
.record-results {
display: inline-block;
margin-bottom: 3px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-inline">
<div class="form-group">
<form action="/SystemAdmin" id="form_header_pager" method="post" name="form_header_pager">
<label for="PageSize">Rows per page:</label>
<select class="form-control" data-val="true" data-val-number="The field PageSize must be a number." data-val-required="The PageSize field is required." id="PageSize" name="PageSizeSelect">
<option selected="selected" value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="ALL">ALL</option>
</select>
</form>
</div>
<div class="form-group ">
<span class="record-results"><strong>Total records:</strong> 0</span>
</div>
<div class="form-group">
<form action="/SystemAdmin" id="form_header_show_records" method="post" name="form_header_show_records">
<label for="showrecords">Show Records:</label>
<select class="form-control" id="ShowRecords" name="showrecords">
<option value="all">Show All Records</option>
<option value="invalid">Show Invalid Records</option>
<option value="valid">Show Valid Records</option>
</select>
</form>
</div>
</div>
JSBIN
your layout is confused me. So I did another to achieve.
The key code:
<form class="form-inline">
<div class="form-group">
<label for="exampleInputName2">Rows per page:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
<div class="form-group">
<label for="exampleInputEmail2">Total records:</label>
<span class="text-danger">99</span>
</div>
<div class="form-group">
<label for="exampleInputName2">Show Records:</label>
<select name="" id="" class="form-control">
<option value="1">test</option>
<option value="1">test</option>
<option value="1">test</option>
</select>
</div>
</form>
<html>
<body>
<form name="orderform" action="order.php" method="POST">
<label>Username</label><br>
<input name="user" type="text" value="" size="10" maxlength="22">
<br>
<label>Items</label>
<div align="left">
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
</div>
<label>Quantity</label>
<div align="left">
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
</div>
<input name="Order" type="submit" value="Order">
</form>
<form name="orderform" action="addtocart.php" method="POST">
<input name="Cart" type="submit" value="Add to Cart">
</form>
</body>
</html>
after executing this code all output is in vertical form i just wanted to make it in a line.please give me a solution i am new in php.
Try this
<!doctype html>
<html>
<head>
<style type="text/css" media="screen">
form div {
display: inline-block;
}
</style>
</head>
<body>
<form name="orderform" action="order.php" method="POST">
<div>
<label>Username</label>
<input name="user" type="text" value="" size="10" maxlength="22">
</div>
<div align="left">
<label>Items</label>
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
</div>
<div align="left">
<label>Quantity</label>
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
</div>
<div>
<input name="Order" type="submit" value="Order">
</div>
<div>
<input name="Cart" type="submit" value="Add to Cart">
</div>
</form>
</body>
</html>
It would be easy to put it all on one line using CSS. You would just remove the default line breaking effects of some elements:
form, form div { display: inline }
form br { display: none }
To do the same in HTML requires modification of the HTML markup, of course. You just remove the div and br tags, but the forms require special treatment: the way to put two forms on one line in HTML is to put them in a table:
<html>
<body>
<table cellpadding=0 cellspacing=0>
<tr><td>
<form name="orderform" action="order.php" method="POST">
<label>Username</label>
<input name="user" type="text" value="" size="10" maxlength="22">
<label>Items</label>
<select name="mydropdown">
<option value="macbook">Macbook</option>
<option value="sony">Sony</option>
<option value="micromax">Micromax</option>
<option value="napolean">Napolean</option>
<option value="motorola">Motorola</option>
</select>
<label>Quantity</label>
<select name="mydropdown">
<option value="quantity1">1</option>
<option value="quantity2">2</option>
<option value="quantity3">3</option>
<option value="quantity4">4</option>
<option value="quantity5">5</option>
</select>
<input name="Order" type="submit" value="Order">
</form>
<td>
<form name="orderform" action="addtocart.php" method="POST">
<input name="Cart" type="submit" value="Add to Cart">
</form>
</table>
</body>
</html>