example:
NAME: <remove><modify>
AGE : <remove><modify>
<add buttons>
or
you can just drag drop new buttons or fields where preferred.
hope someone can help me
Moderator: General Moderators
what do you understand from it? hopefully i know how to explain moreKieran Huggins wrote:That's a rather tall order - but it might need some more thought.
A form represents a data model, one which you have storage for (presumably).
Maybe I don't fully understand what you're actually trying to accomplish?
Code: Select all
name
age
hair colourCode: Select all
name
age
hair_colourKieran Huggins wrote:usually when people collect data, like:they are going to store it in a database that looks like this:Code: Select all
name age hair colourAm I right in thinking you want people to be able to add properties to the form, and then store that? Like adding "eye colour" and have that save in the database?Code: Select all
name age hair_colour
thanks for the encouragement!Kieran Huggins wrote:It could be done, but it's probably more involved then you think it is.
Ok nice questionWhat are you trying to do exactly? Not what are you trying to code, but generally what real-world problem are you trying to solve? There may be a far simpler solution.
Code: Select all
field name field type (select box)
name: [name ] type: [short text |v]
name: [eye colour ] type: [short text |v]
name: [hair colour ] type: [short text |v]
name: [birthday ] type: [short text |v]
name: [bio ] type: [long text |v]
name: [ ] type: [please select... |v]
name: [ ] type: [please select... |v]
name: [ ] type: [please select... |v]Kieran Huggins wrote:might be easier using form inputs:
Code: Select all
field name field type (select box) name: [name ] type: [short text |v] name: [eye colour ] type: [short text |v] name: [hair colour ] type: [short text |v] name: [birthday ] type: [short text |v] name: [bio ] type: [long text |v] name: [ ] type: [please select... |v] name: [ ] type: [please select... |v] name: [ ] type: [please select... |v]
Code: Select all
<input name="fieldname[]" />
<select name="fieldtype[]">
<option value="varchar">Short Text</option>
<option value="text">Long Text</option>
<option value="int">Number</option>
<!-- etc. -->
</select>
<!-- wash, rinse, repeat. -->hurm...the think that i'm wondering is that how to update the database (dynamically) also once you add/removed a field in the form field. I'm going to use PHP and MySQLKieran Huggins wrote:Something like this:Code: Select all
<input name="fieldname[]" /> <select name="fieldtype[]"> <option value="varchar">Short Text</option> <option value="text">Long Text</option> <option value="int">Number</option> <!-- etc. --> </select> <!-- wash, rinse, repeat. -->