Weebly button broken - html

I am trying to get the log in button to work pressing enter in either field posts the form and the button appears but does nothing. Here is the code, any ideas?
Thanks a bunch in advance!
<div><form id="login" action="" method="POST">
<div id="login-form-parent" class="wsite-form-container" style="margin-top: 0px;margin-right: 0px; margin">
<h2 class="wsite-content-title" style="text-align: center;">
<span style="font-size: large;">Please enter your credentials</span></h2>
<div>
<div style= "text-align: center";>
<label class="wsite-form-label" for="name">Username</label>
<div>
<input id="input-616817079299148233" class="wsite-form-input wsite-input wsite-input-width-370px" name="username" type="text" />
</div>
</div>
</div>
<div style="margin-top: 15px;margin-bottom: 15px;"></div>
<div>
<div style="text-align: center";>
<label class="wsite-form-label" for="password">Password</label>
<div>
<input id="input-984837360768012607" class="wsite-form-input wsite-input wsite-input-width-370px" name="pwd" type="password" />
</div>
</div>
</div>
</div>
<div style="display: none; visibility: hidden;"><input name="wsite_subject" type="text" />
</div>
<div style="text-align: center; margin-top: 10px; margin-bottom: 0px;">
<input name="form_version" type="hidden" value="2" />
<input id="wsite-approved" name="wsite_approved" type="hidden" value="approved" />
<input name="ucfid" type="hidden" value="login" />
<input style="position: absolute; top: 0; left: -9999px; width: 1px; height: 1px;" type="submit" />
<a class="wsite-button">
<span class="wsite-button-inner">Submit</span></a></div>
</form></div>

there's no action linked to the form.. fill in action=" " linking to your log in php page.

You would need some handler using jQuery from .wsite-button-inner to trigger your <input type="sumbmit">. Since you hid your input button off screen. When using java script to handle it to have a fancy button best practice would be to add JavaScript validation (not shown in code).
Ie: document.getElementById("login").submit();
or
function submitform()
{
document.login.submit();
}
<div><form id="login" action="" method="POST">
<div id="login-form-parent" class="wsite-form-container" style="margin-top: 0px;margin-right: 0px; margin">
<h2 class="wsite-content-title" style="text-align: center;">
<span style="font-size: large;">Please enter your credentials</span></h2>
<div>
<div style= "text-align: center";>
<label class="wsite-form-label" for="name">Username</label>
<div>
<input id="input-616817079299148233" class="wsite-form-input wsite-input wsite-input-width-370px" name="username" type="text" />
</div>
</div>
</div>
<div style="margin-top: 15px;margin-bottom: 15px;"></div>
<div>
<div style="text-align: center";>
<label class="wsite-form-label" for="password">Password</label>
<div>
<input id="input-984837360768012607" class="wsite-form-input wsite-input wsite-input-width-370px" name="pwd" type="password" />
</div>
</div>
</div>
</div>
<div style="display: none; visibility: hidden;"><input name="wsite_subject" type="text" />
</div>
<div style="text-align: center; margin-top: 10px; margin-bottom: 0px;">
<input name="form_version" type="hidden" value="2" />
<input id="wsite-approved" name="wsite_approved" type="hidden" value="approved" />
<input name="ucfid" type="hidden" value="login" />
<input style="position: absolute; top: 0; left: -9999px; width: 1px; height: 1px;" type="submit" />
<a href="javascript: submitform()" class="wsite-button">
<span class="wsite-button-inner">Submit</span></a></div>
</form></div>
Inline html:
<div><form id="login" action="" method="POST">
<div id="login-form-parent" class="wsite-form-container" style="margin-top: 0px;margin-right: 0px; margin">
<h2 class="wsite-content-title" style="text-align: center;">
<span style="font-size: large;">Please enter your credentials</span></h2>
<div>
<div style= "text-align: center";>
<label class="wsite-form-label" for="name">Username</label>
<div>
<input id="input-616817079299148233" class="wsite-form-input wsite-input wsite-input-width-370px" name="username" type="text" />
</div>
</div>
</div>
<div style="margin-top: 15px;margin-bottom: 15px;"></div>
<div>
<div style="text-align: center";>
<label class="wsite-form-label" for="password">Password</label>
<div>
<input id="input-984837360768012607" class="wsite-form-input wsite-input wsite-input-width-370px" name="pwd" type="password" />
</div>
</div>
</div>
</div>
<div style="display: none; visibility: hidden;"><input name="wsite_subject" type="text" />
</div>
<div style="text-align: center; margin-top: 10px; margin-bottom: 0px;">
<input name="form_version" type="hidden" value="2" />
<input id="wsite-approved" name="wsite_approved" type="hidden" value="approved" />
<input name="ucfid" type="hidden" value="login" />
<input style="position: absolute; top: 0; left: -9999px; width: 1px; height: 1px;" type="submit" />
<a href="javascript: submitform()" class="wsite-button">
<span class="wsite-button-inner">Submit</span></a></div>
</form></div>
<script type="text/javascript">
function submitform()
{
document.login.submit();
}
</script>

Related

How to divide html page

I want to make a html page with three sections and inside each section divide it to left and right. In each section I have three boxes and I want to put two boxes on the left and one box on the right following is the css and html code:
.leftbox {
width: 50%;
padding: 5px;
float: left;
}
.rightbox {
width: 50%;
padding: 5px;
float: right;
}
<div id="rotationFormPopup" class="rotationFormPopup" style="width: 900px; display: none; background: #FFF; border: 1px solid; padding: 10px; margin-top: 100px;">
<h2 class="popup-header">Rotation Forms</h2>
<div class="newRotation-sections">
<h3>Details</h3>
<div class="newRotation-section-1" style="margin-top: 10px;">
<div class="leftbox">
<span>Mob</span> <br />
<input type="text" class="newRotation-mob" style="width: 100%;"><br /><br />
<span>Paddock</span> <br />
<input type="text" class="newRotation-paddock" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Date</span> <br />
<input type="text" class="newRotation-date" style="position: relative; display: inline-block; float: left; width: 100%; margin-top: 10px;"><br /><br />
</div>
</div>
<h3>Fencing options</h3>
<div class="newRotation-section-2" style="margin-top: 10px;">
<div class="leftbox">
<span>Available Today</span> <br />
<input type="text" class="newRotation-available" style="width: 100%;"><br /><br />
<span>Paddock Allocation %</span> <br />
<input type="number" class="newRotation-alloc" value="50" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Required Result</span> <br />
<input type="text" class="newRotation-result" style="width: 100%;"><br /><br />
</div>
</div>
<h3>Assign As Task</h3>
</div>
</div>
</div>
I receive the below result, I don't know why the fencing options jump to the right side.
Here is the image of my work:
I wrote up this using the Bootstrap Framework. It matches your image exactly.
There's a Codepen if you want to fork and play around with it. It's responsive, too.
/* Roboto Font */
#import url('https://fonts.googleapis.com/css?family=Roboto');
html, body {
height: 100%;
}
body {
font-family: 'Roboto', sans-serif;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<div class="container p-5">
<div class="row">
<div class="col-sm-12">
<h5 class="title text-uppercase bg-success text-white p-1">Rotation Forms</h5>
<h4 class="mb-3 mt-3">Details</h4>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="mob">Mob</label>
<input type="text" class="form-control" id="mob" placeholder="Enter Mob">
</div>
<div class="form-group">
<label for="paddock">Paddock</label>
<input type="text" class="form-control" id="paddock" placeholder="Enter Paddock">
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="date">Date</label>
<input type="date" class="form-control" id="date" placeholder="Enter Date">
</div>
<h4 class="mb-3 mt-3">Fencing Options</h4>
<div class="form-group">
<label for="avail">Available Today</label>
<input type="text" class="form-control" id="avail" placeholder="NaN">
</div>
<div class="form-group">
<label for="allocation">Paddock Allocation %</label>
<input type="number" class="form-control" id="allocation" placeholder="100">
</div>
<div class="form-group">
<label for="result">Required Result</label>
<input type="text" class="form-control" id="result" placeholder="NaN">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-6">
<h4 class="mb-3 mt-3">Assign As Task</h4>
<div class="form-group">
<label for="assign">Assign to</label><br>
<button type="submit" class="btn btn-success btn-md" id="assign">Add</button>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="checked">
<label class="form-check-label" for="checked">I want to see this too.</label>
</div>
<button type="button" class="btn btn-success btn-md">Save</button>
<button type="button" class="btn btn-success btn-md">Cancel</button>
</div>
</div>
</div>

trouble aligning the divs and other inner tags at different positions

I'm creating my first ever html page, and I'm trying to do some alignment for divs and labels.
The labels and the input seem out of position even after spending multiple hours trying different combinations. Some properties are not working, like I used width for label and in chrome it says unknown property.
Below is the code. Any help with this would be appreciated.
Preview of the html/css part:
div.btn-toolbar {
position: relative;
top: 100px;
left: 40%;
width: 400px;
}
div.quote-details {
position: relative;
top: 122px;
left: 250px;
font-weight: bold;
font-size: 15px;
}
div.quote-detail-section-left {
float: left;
margin-top: 145px;
margin-left: 100px;
width: 35%;
}
input.quote-input {
padding: 4px;
}
label.field-label {
float: left;
font-weight: bold;
display: inline-block;
margin-left: 40px;
width: :50px;
clear: both;
}
div.quote-detail-section-right {
float: right;
margin-top: 145px;
margin-right: 80px;
width: 35%;
}
<div class="quote-rec-page">
<div class="quote-details">
<label for="section" class="Segment">Quote Details</label>
</div>
<div class="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class="quote-detail-section-left">
<div>
<label for="quoteNum" class="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber" />
</div>
<div>
<label for="quoteName" class="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName" />
</div>
<div>
<label for="oppName" class="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName" />
</div>
<div>
<label for="accName" class="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName" />
</div>
</div>
<div class="quote-detail-section-right">
<div>
<label for="expDate" class="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate" />
</div>
<div>
<label for="sync" class="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync" />
</div>
<div>
<label for="status" class="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status" />
</div>
<div>
<label for="quoteDesc" class="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc" />
</div>
</div>
</form>
</div>
Html/css including apex code:
<apex:page sidebar="false" showHeader="false">
<head>
<title>Quote Details</title>
</head>
<style>
div.btn-toolbar{
position:relative;
top:100px;
left:40%;
width:400px;
}
div.quote-details{
position:relative;
top:122px;
left:250px;
font-weight:bold;
font-size:15px;
}
div.quote-detail-section-left{
float:left;
margin-top : 145px;
margin-left: 100px;
width:35%;
}
input.quote-input{
padding:4px;
}
label.field-label{
float:left;
font-weight:bold;
display:inline-block;
margin-left : 40px;
width::50px;
clear:both;
}
div.quote-detail-section-right{
float:right;
margin-top : 145px;
margin-right: 80px;
width:35%;
}
</style>
<body>
<div class="quote-rec-page">
<div class = "quote-details">
<label for = "section" class="Segment">Quote Details</label>
</div>
<div class ="btn-toolbar">
<button type="button">Edit</button>
<button type="button">Delete</button>
<button type="button">Create PDF</button>
<button type="button">Email Quote</button>
<button type="button">Start Sync</button>
</div>
<form>
<div class ="quote-detail-section-left">
<div>
<label for="quoteNum" class ="field-label">Quote Number</label>
<input type="text" class="quote-input" tabindex="1" id="quoteNumber"/>
</div>
<div>
<label for="quoteName" class ="field-label">Quote Name</label>
<input type="text" class="quote-input" tabindex="2" id="quoteName"/>
</div>
<div>
<label for="oppName" class ="field-label">Opportunity Name</label>
<input type="text" class="quote-input" tabindex="3" id="oppName"/>
</div>
<div>
<label for="accName" class ="field-label">Account Name</label>
<input type="text" class="quote-input" tabindex="4" id="accName"/>
</div>
</div>
<div class ="quote-detail-section-right">
<div>
<label for="expDate" class ="field-label">Expiration Date</label>
<input type="date" class="quote-input" tabindex="5" id="expDate"/>
</div>
<div>
<label for="sync" class ="field-label">Syncing</label>
<input type="checkbox" class="quote-input" tabindex="6" id="sync"/>
</div>
<div>
<label for="status" class ="field-label">Status</label>
<input type="text" class="quote-input" tabindex="7" id="status"/>
</div>
<div>
<label for="quoteDesc" class ="field-label">Description</label>
<input type="text" class="quote-input" tabindex="8" id="quoteDesc"/>
</div>
</div>
</form>
</div>
</body>
</apex:page>

How to display html form next to each other and in rows?

I am currently trying to get two forms next to each other and then two more forms under it all aligned. If anyone has any suggestions to help me out that would be great. Here is my source code in a jsfiddle.
I am trying to get the name and company input next to each other and then the phone and email below it with the comment textbox at the base. I was trying the 40% width and it sort of helped to get the first row. I was thinking of going the table route as I could probably get that working fine for the forms being aligned but I know tables is not the correct route for coding this.
https://jsfiddle.net/xtwistedmetal/two7hgtm/1/
or
<style type="text/css">
#mc_embed_signup {
background: #fff;
clear: left;
font: 14px Helvetica, Arial, sans-serif;
}
.mc-field-group1 {
display: inline-block;
width: 40%;
}
.mc-field-group2 {
display: inline-block;
}
</style>
<div id="mc_embed_signup">
<form method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate="" action="websitehere">
<div id="mc_embed_signup_scroll">
<div align="center">
<h2> Wholesale Contact Form</h2>
</div>
<div class="mc-field-group1">
<label for="mce-FNAME">Name </label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME" />
</div>
<div class="mc-field-group1">
<label for="mce-MMERGE3">Company Name </label>
<input type="text" value="" name="MMERGE3" class="required" id="mce-MMERGE3" />
</div>
<div class="mc-field-group2">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" />
</div>
<br>
<div class="mc-field-group2">
<label for="mce-MMERGE2">Phone Number </label>
<input type="text" name="MMERGE2" class="" value="" id="mce-MMERGE2" />
</div>
<div class="mc-field-group">
<label for="mce-COMMENTS">Comments </label>
<!-- <input type="text" value="" name="COMMENTS" class="required" id="mce-COMMENTS" /> -->
<textarea id="mce-COMMENTS" name="COMMENTS" cols="47" rows="3"> </textarea>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display: none;"></div>
<div class="response" id="mce-success-response" style="display: none;"></div>
</div>
<div class="clear" align="center">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" />
</div>
</div>
</form>
</div>
You can try an approach like below
.form-group:after{
content: "";
display:table;
clear:both;
}
.form-group-half{
width:44%;
padding:0 3%;
float:left;
}
.form-group-half > label{
display:block;
}
.form-group-half > input,
.form-group-half > select,
.form-group-half > textarea {
width:100%;
}
<div class="form-group">
<div class="form-group-half">
<label>Field 1</label>
<input type="text" name="field1">
</div>
<div class="form-group-half">
<label>Field 2</label>
<input type="text" name="field2">
</div>
</div>
<div class="form-group">
<div class="form-group-half">
<label>Field 3</label>
<input type="text" name="field3">
</div>
<div class="form-group-half">
<label>Field 4</label>
<input type="text" name="field4">
</div>
</div>
HTML ;
<div id="mc_embed_signup">
<form method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate="" action="websitehere">
<div id="mc_embed_signup_scroll">
<div align="center">
<h2> Wholesale Contact Form</h2>
</div>
<div class="mc-field-group1" style=>
<div style="width:40%">
<label for="mce-FNAME">Name </label>
<input type="text" value="" name="FNAME" class="required" id="mce-FNAME" />
</div>
<div style="width:40%">
<label for="mce-MMERGE3">Company Name </label>
<input type="text" value="" name="MMERGE3" class="required" id="mce-MMERGE3" />
</div>
</div>
<div class="mc-field-group2">
<div style="width:40%">
<label for="mce-EMAIL">Email Address </label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" />
</div>
<div style="width:40%">
<label for="mce-MMERGE2">Phone Number </label>
<input type="text" name="MMERGE2" class="" value="" id="mce-MMERGE2" />
</div>
</div>
<br>
<div class="mc-field-group">
<label for="mce-COMMENTS">Comments </label>
<!-- <input type="text" value="" name="COMMENTS" class="required" id="mce-COMMENTS" /> -->
<textarea id="mce-COMMENTS" name="COMMENTS" cols="47" rows="3"> </textarea>
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display: none;"></div>
<div class="response" id="mce-success-response" style="display: none;"></div>
</div>
<div class="clear" align="center">
<input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" />
</div>
</div>
</form>
</div>
CSS
<style type="text/css">
#mc_embed_signup {
background: #fff;
clear: left;
font: 12px Helvetica, Arial, sans-serif;
}
.mc-field-group1 {
width: 100%;
display: inline-flex;
}
.mc-field-group2 {
display: inline-flex;
width: 100%;
}
label{
color:red;
width:40px !important;
}

How to change the view in this form?

Following this post , I try to imply the style -
.mktoFormRow:nth-child(odd) {
float: left;
}
on the follow form -
<form id="mktoForm_17" novalidate="novalidate" class="mktoForm mktoHasWidth mktoLayoutLeft" style="font-family: inherit; font-size: 13px; color: rgb(51, 51, 51); width: 171px;" __biza="WJ__">
<input type="hidden" id="country" name="country" value="Israel"><input type="hidden" id="00Nw0000003PHyq" name="00Nw0000003PHyq" value=""><input type="hidden" id="00Nw0000003PHyx" name="00Nw0000003PHyx" value=""><input type="hidden" id="00Nw0000003PHyz" name="00Nw0000003PHyz" value=""><input type="hidden" id="00Nw0000003PHyy" name="00Nw0000003PHyy" value=""><input type="hidden" id="00Nw0000003PHyl" name="00Nw0000003PHyl" value=""><input type="hidden" id="00Nw0000003PHyr" name="00Nw0000003PHyr" value=""><input type="hidden" id="00Nw0000003PHyn" name="00Nw0000003PHyn" value=""><input type="hidden" id="00Nw0000003PHyo" name="00Nw0000003PHyo" value=""><input type="hidden" id="00Nw0000003PHyv" name="00Nw0000003PHyv" value=""><input type="hidden" id="00Nw0000003PHyp" name="00Nw0000003PHyp" value=""><input type="hidden" id="00Nw0000003PHyu" name="00Nw0000003PHyu" value=""><input type="hidden" id="00Nw0000003PHys" name="00Nw0000003PHys" value=""><input type="hidden" id="00Nw0000003PHym" name="00Nw0000003PHym" value=""><input type="hidden" id="00Nw0000003PHyw" name="00Nw0000003PHyw" value=""><input type="hidden" id="00Nw0000003PHyt" name="00Nw0000003PHyt" value="http://localhost/codefuel/">
<style type="text/css"></style>
<div class="mktoFormRow">
<div class="mktoFieldDescriptor mktoFormCol" style="margin-bottom: 5px;">
<div class="mktoOffset" style="width: 5px;"></div>
<div class="mktoFieldWrap mktoRequiredField">
<label for="FirstName" class="mktoLabel mktoHasWidth" style="width: 10px;">
<div class="mktoAsterix">*</div>
</label>
<div class="mktoGutter mktoHasWidth" style="width: 5px;"></div>
<input id="FirstName" name="FirstName" placeholder="Name" maxlength="255" title="" type="text" class="mktoField mktoTextField mktoHasWidth mktoRequired mktoInvalid" style="width: 150px;">
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoFormRow">
<div class="mktoFieldDescriptor mktoFormCol" style="margin-bottom: 5px;">
<div class="mktoOffset" style="width: 5px;"></div>
<div class="mktoFieldWrap mktoRequiredField">
<label for="PersonEmail" class="mktoLabel mktoHasWidth" style="width: 10px;">
<div class="mktoAsterix">*</div>
</label>
<div class="mktoGutter mktoHasWidth" style="width: 5px;"></div>
<input id="PersonEmail" name="PersonEmail" placeholder="Email" maxlength="80" type="email" class="mktoField mktoEmailField mktoHasWidth mktoRequired" style="width: 150px;">
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoFormRow">
<div class="mktoFieldDescriptor mktoFormCol" style="margin-bottom: 5px;">
<div class="mktoOffset" style="width: 5px;"></div>
<div class="mktoFieldWrap mktoRequiredField">
<label for="Application_Download_Link__c" class="mktoLabel mktoHasWidth" style="width: 10px;">
<div class="mktoAsterix">*</div>
</label>
<div class="mktoGutter mktoHasWidth" style="width: 5px;"></div>
<input id="Application_Download_Link__c" name="Application_Download_Link__c" placeholder="Software URL" maxlength="255" type="url" class="mktoField mktoUrlField mktoHasWidth mktoRequired" style="width: 150px;">
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoFormRow">
<div class="mktoFieldDescriptor mktoFormCol" style="margin-bottom: 5px;">
<div class="mktoOffset" style="width: 5px;"></div>
<div class="mktoFieldWrap mktoRequiredField">
<label for="Daily_Installs__c" class="mktoLabel mktoHasWidth" style="width: 10px;">
<div class="mktoAsterix">*</div>
</label>
<div class="mktoGutter mktoHasWidth" style="width: 5px;"></div>
<select id="Daily_Installs__c" name="Daily_Installs__c" class="mktoField mktoHasWidth mktoRequired" style="width: 150px;">
<option value="">Select...</option>
<option value="0-100">0-100</option>
<option value="100-500">100-500</option>
<option value="500-1,000">500-1,000</option>
<option value="More than 1,000">More than 1,000</option>
<option value="Not Applicable">Not Applicable</option>
</select>
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoClear"></div>
</div>
<div class="mktoButtonRow"><span class="mktoButtonWrap mktoNative" style="margin-left: 110px;"><button type="submit" class="mktoButton">Submit</button></span></div>
<input type="hidden" name="formid" class="mktoField mktoFieldDescriptor" value="17"><input type="hidden" name="munchkinId" class="mktoField mktoFieldDescriptor" value="955-BUF-612">
</form>
but nothing got change in the view (here the Demo) .
There is 4 <div class="mktoFormRow"> there .
How could I achieve the view as the result here using nth-child selector ?
Your form has an explicit width of 171px, so those divs don't have enough space to be placed on the same line. Just remove the explicit width, so it will default to 100% (and you probably want even children to be left-floated instead of odd ones).
Solution: http://jsfiddle.net/c4YL4/18/
I will change pretty munch of your code, but, you could display every <div class="mktoFormRow"> as an inline-block and float everything to the left... you will get an horizontal line of those divs. then you could use nth-child(2nd) to clear right every two divs and you will get rows of 2 divs each one... I hope this help.

Align labels under input boxes using Bootstrap

I'm not sure how to go about getting the effect I want here. I have two input boxes that are on the same line and I want to have labels underneath them and aligned to match the respective input box.
<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<label for="decimal_input">Label 1</label>
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
= <label for="input2">Label 2</label>
<input type="text" value="I" width="30" id="input2" class="form-control" />
</div>
</div>
</form>
Take a look at the jsfiddle here for more info:
http://jsfiddle.net/justinhj/bTVKZ/2/
http://jsfiddle.net/isherwood/bTVKZ/6
<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<div class="pull-left">
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
<br />
<label for="decimal_input">Label 1</label>
</div>
<div>
<input type="text" value="I" width="30" id="input2" class="form-control" />
<br />
<label for="input2">Label 2</label>
</div>
</div>
</form>
</div>
Your new HTML:
<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<span class="inner-container">
<label for="decimal_input">Label 1</label>
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
</span>
=
<span class="inner-container">
<label for="input2">Label 2</label>
<input type="text" value="I" width="30" id="input2" class="form-control" />
</span>
</div>
</div>
</form>
</diV>
Your new CSS (of course I would add a class to the labels):
.container {
margin-top: 10px;
}
.inner-container {
position: relative;
}
label {
top: 25px;
left: 5px;
position: absolute;
}
here's the fiddle
You may try this
Extra CSS:
label {
display:block;
}
.form-group {
display:inline-block;
}
Modified HTML:
<div class="container">
<form class="form-inline" role="form">
<div class="form-group">
<input type="text" value="1" width="10" id="decimal_input" class="form-control" />
<label for="decimal_input">Label 1</label>
</div>
<div class="form-group">
<input type="text" value="I" width="30" id="input2" class="form-control" />
<label for="input2">Label 2</label>
</div>
</form>
</div>
DEMO.