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

Hi,
CI 3x

I have a form that submits, then sends the user back to the same form and repopulates the fields if they click a checkbox to "send another after submit"...

All is working fine, the form is presented another time with the populated fields.

My issue is that I would like to empty out *some* of the fields on that second offering.

For example, what is the most elegant way of nulling out a text field, where I am currently using?:
PHP Code:
value="<?php echo set_value('f_eventname'); ?>" 



I know I could do a condition based off that checkbox value, something like:
PHP Code:
value="<?php (isset($submitAnother) ? echo "" : echo set_value('f_eventname')); ?>" 


but wondering if there is a better built-in way in CI?

Thanks!
Reply


Messages In This Thread
conditional set_value() - by dbrooke - 10-07-2016, 02:09 PM
RE: conditional set_value() - by RogerMore - 10-10-2016, 02:09 AM
RE: conditional set_value() - by PaulD - 10-10-2016, 04:22 AM
RE: conditional set_value() - by dbrooke - 10-10-2016, 08:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB