ArrestedDevelopment ArrestedDevelopment - 3 months ago 19
CSS Question

Show form fields successively. (Javascript/CSS)

does anyone know how to show form fields successively like on It looks like Javascript, but I can't find the code. Should be animated and should show the next field without hitting return. Is there a framework for this?

kind regards


You can do it using jquery. Here is a basic example :

  	if ($('#input1').val().length === 5) {
<script src=""></script>
<input id="input1">
<input id="input2" style="display:none;">

In this example, the form opened showing only one field.

On key up, we check if the length of the value of the field is equal to 5.

If it is, we show the second field.