[eluser]Unknown[/eluser]
Hello,
I'm making a simple system with formfield that are coming from the database. In the database I write the html output, but without the set_value/set_radio php code. The reason why is that a simple person with no brains could place a input field in the database by admin.
Now the problem, I want that the field had the set_value, set_radio etc options in it.
What is working:
From database ($formhtml):
<div class="veld"><span>Voornaam</span><input type="text" name="voornaam" class="form100" maxlength="20" value=""></div>
and than do this:
$formhtml = str_replace('value=""','value="'.set_value(''.$input_naam.'').'"',''.$formhtml.'');
That is working fine because it's one field, en the value has no basis value.
But I can't get it good if the code is this:
<div class="veldgeslacht"><span>Geslacht</span><input type="radio" name="geslacht" value="M">Man <input type="radio" name="geslacht" value="V">Vrouw
</div>
As you can see there are 2 radiobuttons in this, and the radiobuttons has an value. How could I do it that on that peace of code also the set_radio is working properly? That the code in the database is as above, but in the controller it will replace with the code including the set_radio information.
Thanks for the help.
Greetings,
Wesley