mercredi 31 mai 2017

How do I save the oldvalue if the input name is variable?

The oldvalue is usually set with the name attribute, in my case the name attribute is variable depending on the id name="option", so I can't find the way to save and load the olvalue, this is my code:

<div class="btn-group" data-toggle="buttons">
   <label class="btn btn-primary">
     <input type="radio" name="option" id="question" autocomplete="off" value="1" data-oldvalue=""> Yes
   </label>
   <label class="btn btn-primary">
     <input type="radio" name="option" id="question" autocomplete="off" value="0" data-oldvalue=""> No
   </label>
</div>

Not sure if the autocomplete="off" will affect my oldvalue to load too. If there is any other approach to get my oldvalues loaded (after validation errors) I would like to know.

Extra info: I usually have between 3 and 5 questions loaded in the view. These questions are part of a poll I'm saving in the controller one by one with a foreach method



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rEg0y9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire