How can I keep the value of form when an error occured

Hi

I am building a big form with Formit and when an error accur, I do not want the user to enter all entries again.

For an inout it work and I did like this

		<div>
			<label for="f_e_name">Nom de l'élève</label>
			<span class="error">[[!+fi.error.f_e_name]]</span><br>
  			<input type="text" id="f_e_name" name="f_e_name" placeholder="Nom de l'élève" value="[[!+fi.f_e_name]]"><br>

		</div>

I added [[!+fi.f_e_name]]

But how can U do it with a select and inout type ‘radio’

How can I add a ‘cheked’ for a radio

<div>
			<h2>Renseignements concernant l’élève</h2>
			<input type="radio" id="f_e_fille" name="f_e_sex" value="fille" />
			<label for="f_e_fille">Fille</label>
			<input type="radio" id="f_e_garcon" name="f_e_sex" value="garcon" />
			<label for="f_e_garcon">Garçon</label>
			<span class="error">[[!+fi.error.f_e_sex]]</span>
		</div>

How can I ‘selected’ for a select when I get back the sent value

<select name="f_p_instrument" id="f_p_instrument">
				<option value="">Choisir</option>
				<option value="Alto">Alto</option>
				<option value="Basson">Basson</option>
				<option value="Batterie">Batterie</option>
				<option value="Chant">Chant</option>
			</select>

Hopefully this might help.

1 Like

Thanks nice, it’s work!!!

1 Like