Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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