PHP - How can I load the same form with some differences concerning the type of fields?
<p>I have a form with some fields of type text and 2 fields (<code>name</code> and <code>second name</code>) that have a value by default, and these 2 fields are of type="hidden".</p>

<p>Now, I would like to add a link on the form "Fill an order for another person". If the user click on this link the same form must be reloaded but with a little difference: the fields name and second name must be of type text to allow the user enter a name/second name.</p>

<p>I can reload the form, but the fields <code>name</code> and <code>second name</code> remain hidden, because I don't know how define a condition that say to change the types if the user clicks on the link.  Could you explain how can I do this? </p>

<p>The fields that are filled by default:</p>

<pre><code>if ($field_label=="Name")
{
    return sprintf("&lt;div class='ginput_container'&gt;$name&lt;input name='input_%d' id='$field_id' type='hidden' value='$name' class='ginput_container' $max_length $tabindex $html5_attributes %s/&gt;&lt;/div&gt;", $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text);
}
else if ($field_label=="Second name")
{
    return sprintf("&lt;div class='ginput_container'&gt;$secondname&lt;input name='input_%d' id='$field_id' type='hidden' value='$secondname' class='ginput_container' $max_length $tabindex $html5_attributes %s/&gt;&lt;/div&gt;", $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text);
}
</code></pre>
