You are not logged in.
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
That is unsupported. Put javascript in the success_form to reload the initial form.
Offline
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
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
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
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
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
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
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
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