Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

conditional set_value()

$
0
0
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!

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>