Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#46 2010-06-24 20:52:29
- mmelon
- Member
- Registered: 2006-03-02
- Posts: 95
Re: mem_simple_form
Hi,
Can somebody humour me and describe what this plugin does? It seems to allow people to send stuff to the textpattern database from the front end. How is this being used? I know mem moderation does something similar but (duh) has a moderation queue. It seems so useful yet I can’t fathom out why.
Thanks for any further info.
Kind regards,
Mike
Offline
Re: mem_simple_form
mem_simple_form is a processor for mem_form that allows you to create new records in any table of Textpattern’s database. I’ve used it to allow users to create new categories and articles.
Offline
Re: mem_simple_form
mmelon wrote:
Can somebody humour me and describe what this plugin does?
Have a look at this thread where I tried to differentiate between the different plugins. One thing I forgot to mention there is that mem_simple_form can be used for own database tables not just textpattern tables. See link below for an (admittedly rather more complex) use case.
aslsw66 wrote:
How can I (1) amend data in the table
If you mean edit a record once you have inserted it, then yes that is possible. I used the attributes id_field="ID" id_insert="0" and then set the id in your form. You need to prepopulate the form with value and default data and in my case I used smd_query to retrieve the article data for a particular article and inserted it into the form using smd_query’s {table-field} notation, e.g.
<txp:mem_form_secret name="int_ID" value="{ID}" />
The submitted form returns a ‘thank you’ message. How can I both display the thank you message and a new instance of the blank form? This is so that someone can go and add a new set of data.
Try calling the form afresh from your thanks form. I’m not sure if this will work or whether you get mismatching nonce problems but it’s easy to try. In my case above I wanted to redisplay the list so I output the list form from the thanks form.
1. Is there a way of posting to a date field using something other than today’s date? If I use the ‘now’ form type, it (correctly) posts today’s date, but I want people to be able to use a future date.
Take a look at the textpattern table and you will see that the date is a string in the form YYYY:MM:DD HH:MM.SS. You can simply write this to your string_Posted field.
TXP Builders – finely-crafted code, design and txp
Offline
Re: mem_simple_form
Ok im confused by this. I need a form that saves the values to a table called “vote”. That table has a feild called submission. i need it to save the value of a select/combo box. Can some one help with the code?
Thanks
Offline
Re: mem_simple_form
Trying to use a forum thread as a bug tracker doesn’t really work for various reasons.
- I don’t always get the email about the thread being updated.
- Different problems get interleaved.
- I’m forget about them and don’t re-read the older pages of a plugin thread looking for unfixed issues.
In an effort to fix this communication disconnect, I have moved all of my plugin code over to bitbucket, /Manfre/txp-plugins. I’ve enabled the issue tracker and wiki (for documentation). With this new channel of managing my plugins, I will continue to ignore issues reported in this plugin thread, but now it will be intentional instead of accidental.
Offline
Re: mem_simple_form
I’m revisiting this, mainly because it offers a simpler solution than multiple processing with smd_query (no offence Stef!).
One thing I would like to do is to display a new, blank form after submission so that the user can see an update table of entries straight away. But if I try to set success_form as the same form that mem_form appears on, I get an internal server error.
What I’m trying to do is display a table of existing values with smd_query, present the user with a form to add a new entry, and then redisplay the table again with the new value in it.
Offline
Re: mem_simple_form
That is unsupported. Put javascript in the success_form to reload the initial form.
Offline
Re: mem_simple_form
Actually, I figured when I looked at the database that the internal server must be cause by the form resubmitting itself with multiple values – my table had many hundreds of entries!
If I use javascript in the successform, do I need to unset the values from the form? I think you mentioned this to someone else in one of your plugin-threads – sorry, I’ve read them all but didn’t catch on to this one.
Offline
Re: mem_simple_form
Use javascript to reload the URL that renders the form. You may need to add a query string to force the reload. When the page reloads, the form will be properly initialized and ready for another submission.
Offline
Re: mem_simple_form
Hello Michael.
Thank you first for this amazing plugin.
I’m trying to update the values recorded in the db from the smd_bio plugin through the use of a dashboard, using the jmd_dashboard plugin and mem_form.
Here’s my code:
<txp:mem_simple_form table="smd_bio">
<txp:mem_form_text name="table_country" label="Country" break="" />
<txp:mem_form_submit />
</txp:mem_simple_form>
It’s working, but instead of updating the information for the current logged in user, it adds another row in my table. Is there a value I can add to update the information for the current logged in user ?
Thanks !
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: mem_simple_form
Guillaume, IIRC the trick is to use the attribute pair id_field="user_ID" id_insert="0" in your mem_simple_form tag and in your contained form use mem_form_secret to inform the plugin about the user ID to update, e.g. something like:
<txp:mem_simple_form table="smd_bio" id_field="user_ID" id_insert="0">
<txp:mem_form_text name="table_country" label="Country" break="" />
<txp:mem_form_secret name="int_user_id" value="{current-user-id-here}" />
<txp:mem_form_submit />
</txp:mem_simple_form>
(not familiar with the smd_bio structure so you might need to adapt this).
Last edited by jakob (2011-02-14 15:03:53)
TXP Builders – finely-crafted code, design and txp
Offline
Re: mem_simple_form
Ahhh vielen Dank Jakob ! It’s working…
<txp:mem_simple_form table="smd_bio" id_field="user_ref" id_insert="0">
<txp:mem_form_text name="table_country" label="Country" break="" />
<txp:mem_form_secret name="int_user_ref" value="{userA}" />
<txp:mem_form_submit />
</txp:mem_simple_form>
Just a minor bug: It’s updating all users: userA, userB (?!)… I’m not sure why… Is this related to the way I use the call above ? Or the way smd_bio is built ?
Last edited by hablablow (2011-02-14 15:42:15)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: mem_simple_form
I’m following the above question… When I update an existing value of a field and press the submit button, it is recorded in the DB… Good !
I run into a problem when it comes to empty a value from a field, the empty value is not recorded in the DB.
In other words I can’t delete a value already entered, I can only replace it with a new value…
Am I missing something obvious here ? An attribute for meme_form that would allow to delete a value already recorded in the DB by simply submitting the value of an empty field…
Cheese !
Last edited by hablablow (2011-03-18 10:30:57)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: mem_simple_form
Tried and tried and kept trying… It just doesn’t work… I’m not sure if this is possible…
Help !
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
#60 2011-05-06 22:04:56
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: mem_simple_form
hablablow dijo:
Ahhh vielen Dank Jakob ! It’s working…
<txp:mem_simple_form table="smd_bio" id_field="user_ref" id_insert="0">
<txp:mem_form_text name="table_country" label="Country" break="" />
<txp:mem_form_secret name="int_user_ref" value="{userA}" />
<txp:mem_form_submit />
</txp:mem_simple_form>
Just a minor bug: It’s updating all users: userA, userB (?!)… I’m not sure why… Is this related to the way I use the call above ? Or the way smd_bio is built ?
I have the same problem with the same table (smd_bio). I try to uptade a field value for userA and it is update for all the user in the smd_bio table. ¿did you found the solution? This is my code:
<txp:mem_simple_form table="smd_bio" id_field="user_ref" id_insert="0">
<txp:mem_form_secret name="int_user_ref" value="{userA}"/>
<txp:mem_form_text name="string_type" label="User type" required="1" break=""/>
<txp:mem_form_submit />
</txp:mem_simple_form>
Last edited by milosevic (2011-05-06 22:09:21)
<txp:rocks/>
Offline