Welcome Guest, Not a member yet? Register   Sign In
Form Helper - set_value()
#1

I have a form setup using the CI Form Helper, mainly the set_value() feature.

The same view file with the form is used for creating new "pages", as well as editing pages, ill use the page_title as an example input from my form.
PHP Code:
<input type="text" id="page_title" name="page_title" value="<?php echo set_value('page_title', @$settings->title); ?>" /> 

So initially, that works fine..
  • If editing a page, then $settings->title will be set and the value will be the page title
  • If creating a new page, it will be empty
  • If creating a new page, and the validation fails, the value will be the previously populated value
I also have it setup so if you select the Create another page checkbox, then it will load the form again, allowing you to re-populate the fields and create another page.

The question I have is, when you populate the values in the field, hit submit, and the page is successfully created, how can I have the form loaded, with the values then being empty?
Reply


Messages In This Thread
Form Helper - set_value() - by jLinux - 08-29-2015, 12:02 PM
RE: Form Helper - set_value() - by RobertSF - 08-29-2015, 04:03 PM
RE: Form Helper - set_value() - by jLinux - 08-29-2015, 07:10 PM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 09:16 AM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 09:36 AM
RE: Form Helper - set_value() - by RobertSF - 08-30-2015, 09:49 AM
RE: Form Helper - set_value() - by jLinux - 08-30-2015, 10:15 AM
RE: Form Helper - set_value() - by RobertSF - 08-30-2015, 10:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB