i have this problem on form validation.
as you can see from image number 1, the user can make a choice. depending on the choice you make, change the form. (image number 2 and 3)
The fields, I put them as mandatory, and the two sections, are display: none, until the user clicks on one of the two buttons.
How can I activate only one form based on the choice made?
If I click on the submit button, while completing the fields of the first form, it asks me for the fields of the second form, as they are mandatory.
Many thanks in advance
jquery code for show button:
$( "#button-ritira" ).click(function() {
$( "#ricevi" ).hide( 1000 );
$( "#ritira" ).show( 400 );
});
$( "#button-ricevi" ).click(function() {
$( "#ritira" ).hide( 1000 );
$( "#ricevi" ).show( 400 );
});
the HTML code:
<div class="row mb-45">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2 text-center">
<label class="label-space-radio-ritira mb-25">
<input type="radio" name="ritira" id="button-ritira" autocomplete="off">
<span class="radiocustom-ritira"></span>
</label>
</div>
<div class="col-lg-4 text-center">
<label class="label-space-radio-ritira mb-25">
<input type="radio" name="ritira" id="button-ricevi" autocomplete="off">
<span class="radiocustom-ricevi"></span>
</label>
</div>
</div>
</div>
</div>
<div class="row" id="ritira">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2">
<div class="input-form-ricevi-ritira">
<label>Nome</label>
<input type="text" name="nome" placeholder="Nome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cognome</label>
<input type="text" name="cognome" placeholder="Cognome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Email</label>
<input type="text" name="email" placeholder="Email" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cellulare</label>
<input type="text" name="cellulare" placeholder="Cellulare" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<img src="img/assets/titolo-quando.svg" alt="titolo quando cremeria opera" class="titolo-quando">
<div class="row m-giorno-ora">
<div class="col-lg-6">
<div class="input-form-ricevi-ritira ">
<label>Giorno</label>
<input type="text" name="giorno" placeholder="gg/mm/aaaa" class="input-giorno" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<div class="input-form-ricevi-ritira ">
<label>Ora</label>
<input type="text" name="ora" placeholder="00:00" class="input-ora" required autocomplete="off">
</div>
</div>
</div>
<img src="img/assets/titolo-dove.svg" alt="titolo dove cremeria opera" class="titolo-dove">
<label class="label-space-radiodove ">Sant'Anna
<span class="inner-light-title-check">Viale Gaetano Luporini, 951 - Lucca</span>
<input type="radio" name="ritiro" autocomplete="off">
<span class="radiodove"></span>
</label>
<label class="label-space-radiodove mb-25">Sant'Alessio
<span class="inner-light-title-check">Via di Sant'Alessio, 927 - Lucca</span>
<input type="radio" name="ritiro" autocomplete="off">
<span class="radiodove"></span>
</label>
</div>
</div>
</div>
</div>
<div class="row" id="ricevi">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2">
<div class="input-form-ricevi-ritira">
<label>Nome</label>
<input type="text" name="nome" placeholder="Nome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cognome</label>
<input type="text" name="cognome" placeholder="Cognome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Email</label>
<input type="text" name="email" placeholder="Email" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cellulare</label>
<input type="text" name="cellulare" placeholder="Cellulare" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<img src="img/assets/titolo-quando.svg" alt="titolo quando cremeria opera" class="titolo-quando">
<div class="row m-giorno-ora">
<div class="col-lg-6">
<div class="input-form-ricevi-ritira ">
<label>Giorno</label>
<input type="text" name="giorno" placeholder="gg/mm/aaaa" class="input-giorno" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<div class="input-form-ricevi-ritira ">
<label>Ora</label>
<input type="text" name="ora" placeholder="00:00" class="input-ora" required autocomplete="off">
</div>
</div>
</div>
<img src="img/assets/titolo-dove.svg" alt="titolo dove cremeria opera" class="titolo-dove">
<div class="input-form-ricevi-ritira input-indirizzo">
<label>Indirizzo</label>
<input type="text" name="indirizzo" placeholder="Inserisci l'indirizzo completo" required>
</div>
</div>
</div>
</div>
</div>
Apart from hiding and showing give your one form class disabled on all input fields. The other one disabledtwo. When you show and hide the form you also enable/disable input filed of other so it wont get posted.
You can see the demo without hiding the fields get disabled.
If by any chance (I doubt) they still ask to be filed because of required, you can also remove/add required on them the same way
$( "#button-ritira" ).click(function() {
//$( "#ricevi" ).hide( 1000 );
//$( "#ritira" ).show( 400 );
$(".disabled").prop('disabled', true);
$(".disabledtwo").prop('disabled', false);
});
$( "#button-ricevi" ).click(function() {
//$( "#ritira" ).hide( 1000 );
//$( "#ricevi" ).show( 400 );
$(".disabledtwo").prop('disabled', true);
$(".disabled").prop('disabled', false);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="row mb-45">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2 text-center">
<label class="label-space-radio-ritira mb-25">
<input type="radio" name="ritira" id="button-ritira" autocomplete="off">
<span class="radiocustom-ritira"></span>
</label>
</div>
<div class="col-lg-4 text-center">
<label class="label-space-radio-ritira mb-25">
<input type="radio" name="ritira" id="button-ricevi" autocomplete="off">
<span class="radiocustom-ricevi"></span>
</label>
</div>
</div>
</div>
</div>
<div class="row" id="ritira">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2">
<div class="input-form-ricevi-ritira">
<label>Nome</label>
<input type="text" name="nome" class="disabled" placeholder="Nome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cognome</label>
<input type="text" name="cognome" class="disabled"placeholder="Cognome" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Email</label>
<input type="text" name="email" class="disabled"placeholder="Email" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cellulare</label>
<input type="text" name="cellulare" class="disabled" placeholder="Cellulare" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<img src="img/assets/titolo-quando.svg" alt="titolo quando cremeria opera" class="titolo-quando">
<div class="row m-giorno-ora">
<div class="col-lg-6">
<div class="input-form-ricevi-ritira ">
<label>Giorno</label>
<input type="text" name="giorno" class="disabled" placeholder="gg/mm/aaaa" class="input-giorno" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<div class="input-form-ricevi-ritira ">
<label>Ora</label>
<input type="text" name="ora" class="disabled" placeholder="00:00" class="input-ora" required autocomplete="off">
</div>
</div>
</div>
<img src="img/assets/titolo-dove.svg" alt="titolo dove cremeria opera" class="titolo-dove">
<label class="label-space-radiodove ">Sant'Anna
<span class="inner-light-title-check">Viale Gaetano Luporini, 951 - Lucca</span>
<input type="radio" name="ritiro" class="disabled" autocomplete="off">
<span class="radiodove"></span>
</label>
<label class="label-space-radiodove mb-25">Sant'Alessio
<span class="inner-light-title-check">Via di Sant'Alessio, 927 - Lucca</span>
<input type="radio" name="ritiro" class="disabled" autocomplete="off">
<span class="radiodove"></span>
</label>
</div>
</div>
</div>
</div>
<div class="row" id="ricevi">
<div class="col-lg-12">
<div class="row">
<div class="col-lg-4 offset-lg-2">
<div class="input-form-ricevi-ritira">
<label>Nome</label>
<input type="text" name="nome" placeholder="Nome" class="disabledtwo" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cognome</label>
<input type="text" name="cognome" placeholder="Cognome" class="disabledtwo" required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Email</label>
<input type="text" name="email" placeholder="Email" class="disabledtwo"required autocomplete="off">
</div>
<div class="input-form-ricevi-ritira">
<label>Cellulare</label>
<input type="text" name="cellulare" placeholder="Cellulare" class="disabledtwo"required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<img src="img/assets/titolo-quando.svg" alt="titolo quando cremeria opera" class="titolo-quando">
<div class="row m-giorno-ora">
<div class="col-lg-6">
<div class="input-form-ricevi-ritira ">
<label>Giorno</label>
<input type="text" name="giorno" placeholder="gg/mm/aaaa" class="disabledtwo"class="input-giorno" required autocomplete="off">
</div>
</div>
<div class="col-lg-4">
<div class="input-form-ricevi-ritira ">
<label>Ora</label>
<input type="text" name="ora" placeholder="00:00" class="disabledtwo" class="input-ora" required autocomplete="off">
</div>
</div>
</div>
<img src="img/assets/titolo-dove.svg" alt="titolo dove cremeria opera" class="titolo-dove">
<div class="input-form-ricevi-ritira input-indirizzo">
<label>Indirizzo</label>
<input type="text" name="indirizzo" placeholder="Inserisci l'indirizzo completo" class="disabledtwo" required>
</div>
</div>
</div>
</div>
</div>
Related
Although button type is submit, name attributes are same for radio buttons, there is action and method attributes for form, and all other requirements are done, input required attribute is still not working.
there is no novalidate attribute in the form as well.
<form action="" method="">
<div class="form-group">
<div class="form-checkbox">
<label for="resheadpay1">
<input id="resheadpay1" type="radio" id="payinthecar" name="flight-type" required/>
<span></span>Pay in the Car
</label>
<label for="resheadpay2">
<input id="resheadpay2" type="radio" id="paybycreditcard" name="flight-type" />
<span></span>Pay by Credit Card
</label>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input id="txtSource" class="form-control" name="pickLocation" type="text" placeholder="Pickup Location" required/>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input id="txtDestination" class="form-control" type="text" name="dropLocation" placeholder="Dropoff Location" required/>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<input id="txtdate" class="form-control" placeholder="Date" type="date" name="datepick" required/>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<input id="txttime" class="form-control" type="text" id="datetimepicker" name="timepick" placeholder="hh:mm" required/>
</div>
</div>
<div class="col-md-3">
<div class="form-btn">
<button class="submit-btn" onclick="GetRoute(); showres(); hidebooking(); changeText();" type="submit">Book Now </button>
</div>
</div>
</div>
</form>
I have two fieldsets in first div and then im using panel but my panel is covering from above div, Please see the below screen shots
1.) With Filedsets and details
2.) After adding panel, Panel-heading to page it covers the whole content
<div class="container">
<div class="enquiry">
<fieldset class="col-md-12">
<legend><h3>Nag</h3></legend>
<div class="row form-group">
<div class="col-md-4">
<h4>DOB: <span>22-April-2001, Male</span> </h4>
<h4>Enquired: <span>07 </span> </h4>
<h4>Academic Year: <span>2017-2018</span></h4>
</div>
<div class="col-md-4">
<h4>Nagarjuna (Father)</h4>
<h4><i class="fa fa-phone"></i> 9635821471</h4>
<h4><i class="fa fa-envelope"></i> <span class="enq-parent-email">nag.akki#gmail.com</span> </h4>
</div>
<div class="col-md-4">
<h4>
<i class="fa fa-home fa-2x"></i>
</h4>
</div>
</div>
</fieldset>
<fieldset class="col-md-12 margin-bottom">
<legend><h3>Overview</h3></legend>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>Current Name: </label>
<input type="text" class="form-control" readonly="" value="Name">
</div>
<div class="col-md-4">
<label>Current Loasdaf Name: </label>
<input type="text" class="form-control" readonly="" value="asdfaiwewrw">
</div>
<div class="col-md-4">
<label>fasdaskdlfa;skdljfa;skldf</label><br>
<input type="radio" name="transport" readonly="" checked=""> Yes
<input type="radio" name="transport" readonly=""> no
</div>
</div>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>Current Address: </label>
<input type="text" class="form-control" readonly="" value="#07, Kondar, Melborne-38">
</div>
<div class="col-md-4">
<label>asdfasdfasdf</label>
<input type="text" class="form-control" readonly="" value="asdfasd">
</div>
<div class="col-md-4">
<label>asdfasdfasdfasd</label><br>
<input type="radio" name="visit" readonly="" checked=""> Yes
<input type="radio" name="visit" readonly=""> no
</div>
</div>
<div class="row form-group margin-bottom">
<div class="col-md-4">
<label>asdfasdfasdfa</label>
<input type="text" class="form-control" readonly="" value="asdfasdf">
</div>
<div class="col-md-4">
<label>asdfasdfasdfasd</label>
<input type="text" class="form-control" readonly="" value="asdfasdf">
</div>
<div class="col-md-4">
<label>asdfasdfasdfas</label><br>
<input type="radio" name="visit" readonly="" checked=""> Yes
<input type="radio" name="visit" readonly=""> no
</div>
</div>
<div class="row form-group">
<div class="col-md-4">
<label>Enquiry Status </label>
<select class="form-control">
<option value="">Select Status</option>
<option value="Inprogress">Inprogress</option>
<option value="ConvertedtoApplication">Converted to Application</option>
<option value="Cloased, Not Interested"></option>
</select>
</div>
<div class="col-md-8">
<label>Questions ?</label>
<textarea class="form-control" rows="3"></textarea>
</div>
</div>
</fieldset>
</div>
<br>
</div>
This is very strange for me because i never seen such kind of issues.
Waiting for some response, Thanks in Advance!!
You can use row class in bootstrap.try this
<div class="container">
<div class="row">
<div class="enquiry">
<fieldset class="col-md-12">
.................................
</fieldset>
<fieldset class="col-md-12 margin-bottom">
........................................
</fieldset>
</div>
</div>
<div class="row">
<h1>
Add Here your content
</h1>
</div>
</div>
So simply trying to make a html form submit but my layout uses a lot of divs and classes and doesn't seem to be getting the names / ids of them to post i think its not working due to everything inside the form the div's etc but of course this is the layout its late in the morning so could be missing something/ missed something out
<?php
if (isset($_POST["submit"]) && !empty($_POST["submit"])) {
echo "testing";
}
?>
<h3 class="widget-title text-dark">
Cart summary
</h3>
<div class="clearfix"></div>
</div>
<div class="widget-body">
<div class="row">
<form action="checkout.php" method="POST">
<div class="col-sm-6 margin-b-30">
<div class="row">
<div class="col-sm-6">
<label>First Name*</label>
<input type="text" class="form-control" id="fname" name="fname" placeholder="John"> </div>
<!--/form-group-->
<div class="col-sm-6">
<div class="form-group">
<label>Last Name*</label>
<input type="text" class="form-control" id="lname" name="lname" placeholder="Doe"> </div>
<!--/form-group-->
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label>Full Address*</label>
<input type="text" class="form-control" id="Address" placeholder="124, Lorem Street.."> </div>
<!--/form-group-->
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Post code*</label>
<input type="text" class="form-control" id="Post code" placeholder="G52 2LW"> </div>
<!--/form-group-->
</div>
<div class="col-sm-6">
<div class="form-group">
<label>phone*</label>
<input type="text" class="form-control" id="phone" placeholder="123-345-3322"> </div>
<!--/form-group-->
</div>
<div class="payment-option">
<ul class=" list-unstyled">
<li>
<label class="custom-control custom-radio m-b-20">
<input id="radioStacked1" name="radio-stacked" type="radio" class="custom-control-input"> <span class="custom-control-indicator"></span> <span class="custom-control-description">Payment on delivery</span>
<br> <span>Please send your cheque to Store Name, Store Street, Store Town, Store State / County, Store Postcode.</span> </label>
</li>
<li>
<label class="custom-control custom-radio m-b-10">
<input name="radio-stacked" name="submit2" type="radio" class="custom-control-input"> <span class="custom-control-indicator"></span> <span class="custom-control-description">Paypal <img src="images/paypal.jpg" alt="" width="90"></span> </label>
</li>
</ul>
<p class="text-xs-center"> Pay now </p>
</div>
</div>
</form>
A big thank you in advance
http://prntscr.com/g7gc12
ok i fixed it it was the button i changed this
<p class="text-xs-center"> Pay now </p>
to
<div class="col-xs-12">
<button class="btn btn-lg theme-btn" type="submit">Update Info</button>
</div>
Problem fixed thank you
I want to align all the fields vertically which is exactly one below another. Currently all the fields are aligned randomly I am using bootstrap css The layout should be something like this:
Label1: Textbox1
Label2: Textbox2
Here is the code snippet:
Which class can i use to fix the alignment of textbox? Any help?
<div ng-controller="headerCtrl">
<div class="container" style="background-color:white">
<h2 style="color:black; text-align:center" ><b>Timesheet Information</b></h2>
<div class="panel-group" id="accordion">
<div class="panel panel-default">
<!--<div class="panel-heading">
<h4 class="panel-title" style="text-align: center">
<a>Add the Headers </a>
</h4>
</div>-->
<div class="panel-body">
<section>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group" style="margin-left:-125px;">
<label for="currentmonth">Total Work days in Current Month:</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="currentmonth" name="currentmonth" ng-model="currentmonth" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave" style="position:relative;left:-122px;">Annual Leave :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave" style="position:relative;left:-140px;">Sick / Emergency Leave :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="sickleave" name="sickleave" ng-model="sickleave" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave" style="position:relative;left:-122px;">Total Leave in current month (Annual Leave + Sick / Emergency Leave) :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="leave" name="leave" ng-model="leave" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave" style="position:relative;left:-122px;">Total leaves from joining in FG until Previous Month 2016 (excluding Current Month 2016 ) :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="leave1" name="leave1" ng-model="leave1" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave" style="position:relative;left:-122px;">Month your name was added in Field Glass :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="field" name="field" ng-model="field" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
</section>
<div class="pull-right">
<button type="submit" class="btn btn-primary" ng-click="Save()">Submit</button>
<button type="clear" class="btn btn-default" ng-click="clear()">Clear</button>
</div>
</div>
</div>
</div>
<div>
</div>
</div>
</div>
<div class="row">
<form>
<div class="form-group">
<label class="col-md-4" for="currentmonth">Total Work days in Current Month:</label>
<input class="col-md-4" type="text" class="form-control" id="currentmonth" name="currentmonth" ng-model="currentmonth" placeholder="Enter the details" required>
<div class="col-md-4"></div>
</div>
</form>
</div>
<div class="row">
<form>
<div class="form-group">
<label class="col-md-4" for="annualeave">Annual Leave :</label>
<input class="col-md-4" type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
<div class="col-md-4"></div>
</div>
</form>
</div>
This answer is different from the above answer given by Rafa Romero.
I have added different style for these.
Here is the 2 ways you can use this .
<section>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group" style="margin-left:-125px;">
<label for="currentmonth">Total Work days in Current Month:</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="currentmonth" name="currentmonth" ng-model="currentmonth" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group">
<label for="annualeave">Annual Leave :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
</section>
<br><h1 class="text-center">OR</h1><br>
<section>
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group" style="margin-left:-125px;">
<label for="currentmonth">Total Work days in Current Month:</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="currentmonth" name="currentmonth" ng-model="currentmonth" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
<br />
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form class="form-inline" style="">
<div class="form-group" >
<label for="annualeave" style="position:relative;left:-122px;">Annual Leave :</label>
</div>
<div class="form-group">
<input type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
</div>
</form>
</div>
</div>
</section>
You are using bootstrap class so do one thing use columns and give .col-sm-8 and .com-sm-4 respectively and check.
<div class="form-group">
<label for="annualeave" class="col-sm-8">Annual Leave :</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
</div>
</div>
You can try with absolute position for the texfields and aligning both at the same distance from the right or left side
input{
position: absolute;
left: 275px
}
<form class="form-inline" style="margin-left:20px">
<div class="form-group">
<label for="currentmonth">Total Work days in Current Month:</label>
<input type="text" class="form-control" id="currentmonth" name="currentmonth" ng-model="currentmonth" placeholder="Enter the details" required>
</div>
</form>
</div>
<br />
<div class="row">
<form class="form-inline" style="margin-left:20px">
<div class="form-group">
<label for="annualeave">Annual Leave :</label>
<input type="text" class="form-control" id="annualeave" name="annualeave" ng-model="annualeave" placeholder="Enter the details" required>
</div>
</form>
</div>
<br />
I am new to HTML. I am wondering if you could have two forms setting next to each other in parallel in HTML. I have generated this sample GUI with Tkinter and I want to generate a HTML file for the GUi with Bootstrap style.
Something like this would do it: (The borders are just so you can see the effect.)
div
{
border: 1px solid red;
}
#left
{
float: left;
width: 64%;
}
#right
{
float: right;
width: 35%;
}
<div id="left">Left Stuff</div>
<div id="right">Right Stuff</div>
Yea...
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7">
<form action="" method="POST" class="form-horizontal" role="form">
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<button type="button" class="btn btn-default">SUBMIT</button>
</div>
</form>
</div>
<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<form action="" method="POST" class="form-horizontal" role="form">
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<span class="label">Label</span>
<input type="text" name="" id="input" placeholder="Input" class="form-control" value="" required="required">
</div>
<div class="form-group">
<button type="button" class="btn btn-default">SUBMIT</button>
</div>
</form>
</div>
</div>
Hope this helps
I do not know your html file, but I think bootstrap can provide a built-in solution. Just refer to the official documentation and start with a basic template like this:
<div class="container">
<div class="row">
<div class="col-sm-8"> <--the big form-->
<form id="big">
<div class="form-group">
...
</div>
</form>
</div>
<div class="col-sm-4"> <--the small one-->
<form id="small">
<div class="form-group">
...
</div>
</form>
</div>
</div>
</div>
You can use many other classes and of course customize your own in your stylesheet
Well, if you're using Bootstrap, it's very easy. Try the following :
<html>
<head>
<title>Sample</title>
<link rel="stylesheet" type="text/css" href="bootstrap.css" />
</head>
<body>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<div class="col-md-2">
<label for="label-name" class="control-label">Text Here</label>
</div>
<div class="col-md-6">
<input type="text" class="form-control" id="some-text">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<div class="col-md-2">
<label for="label-name" class="control-label">Text Here</label>
</div>
<div class="col-md-6">
<input type="checkbox">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2"></div>
<div class="col-md-6">
<button type="button" class="btn btn-default">Run</button>
</div>
</div>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="bootstrap.min.js"></script>
</body>
</html>
Ok, sounds like 1 form, you just want it styled a certain way:
<div class="row">
<div class="form-group">
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<p>Settings</p>
<label for="label-name" class="control-label">Label1</label>
<input type="text" class="form-control" id="some-text">
<label for="label-name" class="control-label">Label2</label>
<input type="text" class="form-control" id="some-text">
<label for="label-name" class="control-label">Label3</label>
<input type="text" class="form-control" id="some-text">
</div>
<div class="col-xs-6 col-sm-6 col-md-6 col-lg-6">
<p>Options</p>
<label for="label-name" class="control-label">Label4</label>
<input type="checkbox"></br>
<label for="label-name" class="control-label">Label5</label>
<input type="checkbox"></br>
<label for="label-name" class="control-label">Label6</label>
<input type="checkbox">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<button type="button" class="btn btn-default">Run</button>
</div>
</div>