webforms - codeigniter sticky forms -
I am starting to use CII today. I usually use KPHP but one of the small projects A whole lot needs "heavy"
What is the easiest way to apply sticky forms in CI (retaining user input after reloading)?
I currently have lots of radio buttons for multiple choice quiz and some other text areas and when the verification fails, the data is lost ...
I could probably Do not need session wars because I'm not redirected, I'm just loading the view on the validity failure, so the data should be available in $ _POST.
have you seen? Most of the CodeIgniter handling the underlying form is there. Use the set_value ()
function to reset the values after reloading the form:
& lt; Input type = "article" name = "some field" value = "& lt;? Php echo set_value ('some field', 'default') ;? gt; size =" 50 "/>
Note that to work for set_value ()
, you need to run verification on that field. If you do not need this to validate every field in your field, you can set that blank rule, which will let the Validation Library from that field:
$ This- & gt; Validation-> Set_rels (array ('some fields' = & gt; ''));
For radio buttons, see form hackers set_radio ()
function.
Comments
Post a Comment