Welcome Guest, Not a member yet? Register   Sign In
Update Form Validation
#4

[eluser]harpster[/eluser]
I didn't get much response here so maybe I didn't ask the question well enough. I did a lot more research and finally found something related to what I was looking for. So when you first load the update form you check or set a variable and load your db record. Then if you submit the update form with an error it will check the variable ($ae in this case) and if unset will repopulate the form with he set_value('name') from the validation.

Code:
<?php echo form_input('name',
    ($ae == 'edit') ? $records[0]->name : set_value('name')
); ?>

Is there a more desired way to handle this or is this good? I'm working hard to learn CI bit it's taking some time and some of the tutorials and videos out there are either dated or incomplete in regards to the complete CRUD with validation. Thanks!


Messages In This Thread
Update Form Validation - by El Forum - 02-24-2011, 11:21 AM
Update Form Validation - by El Forum - 02-24-2011, 12:33 PM
Update Form Validation - by El Forum - 02-24-2011, 01:12 PM
Update Form Validation - by El Forum - 02-25-2011, 01:07 PM
Update Form Validation - by El Forum - 02-25-2011, 05:20 PM
Update Form Validation - by El Forum - 02-25-2011, 05:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB