Page 1 of 1
Adding text fields, areas, buttons online-modifying online
Posted: Fri Jun 20, 2008 9:40 pm
by newboard
I want to create an admin page where the admin can modify a form in certain pages without opening up the code, i.e just click a certain box and a text field would appear/removed. is it possible?
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

Re: Adding text fields, areas, buttons online-modifying online
Posted: Sat Jun 21, 2008 3:35 am
by calcop
Yes, it is possible.
Re: Adding text fields, areas, buttons online-modifying online
Posted: Sat Jun 21, 2008 3:39 am
by Kieran Huggins
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?
Re: Adding text fields, areas, buttons online-modifying online
Posted: Sat Jun 21, 2008 11:12 pm
by newboard
Kieran 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?
what do you understand from it? hopefully i know how to explain more
Re: Adding text fields, areas, buttons online-modifying online
Posted: Sun Jun 22, 2008 2:51 am
by Kieran Huggins
usually when people collect data, like:
they are going to store it in a database that looks like this:
Am 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?
Re: Adding text fields, areas, buttons online-modifying online
Posted: Sun Jun 22, 2008 6:44 pm
by newboard
Kieran Huggins wrote:usually when people collect data, like:
they are going to store it in a database that looks like this:
Am 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?
yup exactly.
now it can becomes(assuming you have this fields):
age <text field>
hair colour <text field>
eye colour <text field>
So this 'people' would be the Administrator. He can click some button in order to get the new field inserted in some place. (the reason is so that any Administrator can admin the page without knowing PHP). The admin can also remove the field by just clicking some button if provided. can it be done?
i.e:
age <text field> (delete)
hair colour <text field> (delete)
eye colour <text field> (delete)
if you notice, that when you create a new/update post, we have the toolbox where we can just 'click' if we want our letters to be bold, underline, etc. it's something like that i want to achieve.
Re: Adding text fields, areas, buttons online-modifying online
Posted: Sun Jun 22, 2008 8:01 pm
by Kieran Huggins
It could be done, but it's probably more involved then you think it is.
What 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.
Re: Adding text fields, areas, buttons online-modifying online
Posted: Mon Jun 23, 2008 9:18 pm
by newboard
Kieran Huggins wrote:It could be done, but it's probably more involved then you think it is.
thanks for the encouragement!
What 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.
Ok nice question
What i'm trying to do is that i want to make a page for the Administrator where the Admin can change/update/delete the form by just clicking some buttons or dragging/dropping some buttons or icons without even seeing the programming codes. With this we don't have to have a specific Admin who knows certin server language. The admin just need to drag drop or click here and there to update the form. Hope you have some ideas how i can do this. Yeah i know it's a lots of work here but its seems to be fun!
Re: Adding text fields, areas, buttons online-modifying online
Posted: Tue Jun 24, 2008 8:32 am
by Kieran Huggins
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]
Re: Adding text fields, areas, buttons online-modifying online
Posted: Tue Jun 24, 2008 8:52 am
by newboard
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]
owh...how to do it? any tutorials? would like to explore it. thanks!!
Re: Adding text fields, areas, buttons online-modifying online
Posted: Tue Jun 24, 2008 9:18 am
by Kieran Huggins
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. -->
Re: Adding text fields, areas, buttons online-modifying online
Posted: Tue Jun 24, 2008 5:43 pm
by newboard
Kieran 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. -->
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 MySQL