Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do you validate this code?

Featured Replies

If someone could have a look at this and try and make it work then show me the code and explain it then that would be much apperciated, thanks.

 

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>

I'm not 100% sure what you are asking here.

 

If you mean you want the form inputs, select box and button to line up horizontally change :

 

 

.form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: middle;
padding-left: 1%;
padding-right: 1%;
}
 

to

 

 

.form-group {
display: inline-block;
margin-bottom: 0;
vertical-align: baseline;
padding-left: 1%;
padding-right: 1%;
}
 

That should work in most browsers and IE9 up. In IE8 and below the select and button will be a shade higher.

 

Unless you mean how to set validation.

 

That can be done using HTML5 validation, javascript validation or validating in the submission script.

 

Or do you want a submission script?

I notice your <form> tag has no method="post" action="filename.ext" in it.

 

Are you struggling to make the form pass you the information? If so this might be of use to you - php form tutorial on HTML form guide, it is only the basics but is a good starting point.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.