April 19, 201412 yr Hi, Check this code out: <form class="form-inline"> <div class="form-group"> <label class="sr-only" for="registration">Registreringsnummer</label> <input type="text" class="form-control"> </div> <div class="form-group"> <label class="sr-only" for="dittpersonnummer">Ditt personnummer (11 siffer)</label> <input type="password" class="form-control" placeholder="DDMMAAnnnnn"> </div> <div class="form-group"> <select class="form-control"> <option>Velg</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option></select></div><div class="form-group"><button type="submit" class="button-2">Neste</button></div></form> I have a form going across horizontally formatted and everything, but I am new to this and I am wondering how would you validate this? I am so confused with the form group, form inline etc. Some of you may say I should know as I coded it but I grabbed it off Bootstrap to assist me in the making. Thanks.
April 19, 201412 yr Author If you guys are gonna do this in CodePen this is the CSS just so you can see it properly. .form-control { font-size: 14px; font-weight: normal; line-height: 1; color: #555; background-color: #eee; border: 1px solid #ccc; border-radius: 4px; padding-top: 6px; padding-right: 12px; padding-bottom: 6px; padding-left: 12px;}.form-inline { width: 100%;}.form-group { display: inline-block; margin-bottom: 0; vertical-align: middle; padding-left: 1%; padding-right: 1%; }.sr-only { display: block; padding: .2em .6em .3em; font-size: 75%; line-height: 1; white-space: nowrap; vertical-align: baseline; border-radius: .25em;} More of the HTML below: <div class="div-box-5"> <div class="bottom-centre-text"><h2>Kjøp bilforsikring i to enkle trinn</h2><form class="form-inline"> <div class="form-group"> <label class="sr-only" for="registration">Registreringsnummer</label> <input type="text" class="form-control"> </div> <div class="form-group"> <label class="sr-only" for="dittpersonnummer">Ditt personnummer (11 siffer)</label> <input type="password" class="form-control" placeholder="DDMMAAnnnnn"> </div> <div class="form-group"> <select class="form-control"> <option>Velg</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option></select></div><div class="form-group"><button type="submit" class="button-2">Neste</button></div></form> </div> </div>
April 20, 201412 yr You are planning on validating server side too right? In any case it would probably do you good to learn JavaScript because it sounds like you are wanting us to do it for you. Please excuse if I am wrong.
Create an account or sign in to comment