You are not logged in.
Please go to http://bitbucket.org/Manfre/txp-plugins if you…
I do not regularly follow this thread anymore. Any problems or questions posted here will most likely only get answered by other forum members.
In an effort to empower more Textpattern users, I have created the plugin mem_simple_form. This plugin will allow a site owner to create a form that is able to accept an arbitrary number of fields and store them in to an existing database table. Basic processing can be done to the fields after the form is submitted.
mem_simple_form version 0.3
This tag will output an HTML form. The HTML form field names must follow the pattern “type_name”, where type is a value from the below type list. The database table’s field name must match name exactly.
Form Types:
mem_simple_if_ps
Conditional tag that checks to see if a HTML field was posted, or if it has a specific value.
mem_simple_ps
This tag will output the value of the posted HTML form field.
Example
This example will create a form that will allow a user to add a new “Page” to Textpattern and the contents of the textarea will be parsed for Textile tags prior to saving.
<txp:mem_simple_form table="txp_page" id_field="name" id_insert="0">
<txp:mem_form_text name="string_name" label="Title" required="1" />
<br />
<txp:mem_form_textarea name="textile_user_html" label="Template" />
<br />
<txp:mem_form_submit />
</txp:mem_simple_form>
Last edited by Manfre (2010-10-03 16:19:40)
Offline
$form attribute is quite never initialized. if (!empty($form)) {
$thing = fetch_form($form);
unset($atts['form']);
}
Try wet_quicklink | Me | @rwetzlmayr | +Robert Wetzlmayr | Repos
Offline
1. mem_simple_form uses mem_form, which was originally a modified/abstracted version of the form processing logic in ZCR. It uses a nonce to ensure that a form is used only once for each empty form load. Plugin developers can also create spam filters for the form in a fashion similar to ZCR. The next release (in SVN and testing) will have the ability to specify HTML fields that will not be saved to the database, which will allow for captcha’s and honeypot fields.
2. Thanks.
Offline
Conclusion from initial test: Wonderful! Thanks!
Offline
Two Three quick questions:
simple_form? Comments are allowed by default in my admin prefs. Is there a field in the textpattern table I can target for this?body or body_html, but not both.mem_form_select_category tag? I can send a string to the category1 field using other input methods, but it doesn’t connect.Thank you again!
Offline
1. Annotate=1
2. mem_form_hidden name=“body_html”, use javascript to populate the field from the body field on submit. (same for excerpts)
3. The string needs to be the name and not the title. E.g. “my-category” instead of “My Category”
Offline
I haven’t tested this against 4.0.8, but will look in to it.
Offline
Thank you, sir!
What’s the correct version of the plugin to use— v0.1 or v0.2?
Also, what fields from the textpattern table must be informed by the plugin, my use of input fields, in order to create a record successfully?
Thanks again.
Last edited by johnstephens (2009-01-29 19:11:09)
Offline
I’m using this plugin to create a registration form and it’s awesome! I’m very thankful for your work on this.
I’m wondering if it’s possible to have two submit buttons?
Reason being that we’re having a regional get together and we’re wanting to let people sign up and pay now, or sign up and pay when they arrive. I’m using the mem_simple_form to collect the data, and then send it back to the page in a table using smd_query so that people can see who will be attending. Is it possible to send the info to my database and redirect the user to a paypal page that I’m creating? And then have the other button give a simple thanks message like “Thanks! See you there!”
Is this a bit out of the realm of this plugin? Or am I missing something? I’ve been poring through your documentation for a couple days now and my eyes are slightly crossed.
Either way, thanks for the awesome plugin.
Jason
Offline
Jason, the plugin does not currently support that, but you might be able to work a bit of javascript magic to make it happen. You could try having each of the submit buttons change the form’s action query string before the form submits.
Offline