Welcome Guest, Not a member yet? Register   Sign In
set_value not pulling through results with variable based field name.
#1

[eluser]danmatthews[/eluser]
Hi all,

I'm using a while() loop to create a set of 8 exact same sets of form elements for a survey building application. The while loop uses a counting variable "$i" to keep track of the field number. Posted a sample from the view file below.
Code:
&lt;?php $i =1; while($i <= 8) : ?&gt;
    
<div class="field-container">

<h2>Field #&lt;?=$i?&gt;</h2>
    

    <div class="field-field-container">

        <label for="">Field Name</label>
        
        &lt;?php echo form_input("fields[$i][name]"); ?&gt;
        
        <div class="field-description">All lowercase, only hyphens (-) and underscores (_) allowed please!</div>
    </div>

The problem i'm having while using the form validation class is that when using set_value() to retrieve the submitted value, i'm trying to tie the field name with the $i variable like so:
Code:
&lt;?php echo form_input("fields[$i][name]", set_value("fields[$i][name]"); ?&gt;

But it doesn't seem to be picking it up! It's acting like a major block to my applications' development. Just wondered if this was something i was doing wrong, if it's not possible at all, or if this is a bug.

Cheers.


Messages In This Thread
set_value not pulling through results with variable based field name. - by El Forum - 06-05-2011, 03:16 PM



Theme © iAndrew 2016 - Forum software by © MyBB