Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: mem_form - Generic HTTP form processing
Hello,
sorry I’m having troubles trying to make this plugin work. With this code
<txp:mem_form>
<txp:mem_form_submit />
</txp:mem_form>
I get this error:
Textpattern Warning: Argument not specified for mem_form tag
Thanks!
Offline
Re: mem_form - Generic HTTP form processing
Just found the missing thing, it’s type
Offline
Re: mem_form - Generic HTTP form processing
I found just this oddity in mem_form, that is if set no label in a <txp:mem_form_checkbox /> I get <label>checkbox</label>
I can set label to “”, then create a label on my own (that’s for positioning in the page). But the tag generates a label tag as well, so that I have two labels in the end.
Am I midoing something?
Thanks
Offline
Re: mem_form - Generic HTTP form processing
Can’t you use the built-in classes and/or IDs for positioning?
In my template, I have something like this:
<txp:mem_form_checkbox
break=""
name="myField"
label="Check here to put a check in the checkbox"
required="0"/>
And it generates, HTML like this:
<input type="checkbox" id="myField" class="memCheckbox " name="myField" /><label for="myField" class="memCheckbox myField">Check here to put a check in the checkbox</label>
The multiple classes and IDs give me significant leeway for positioning.
Offline
Re: mem_form - Generic HTTP form processing
Thanks John.
I have this conundrum also, with radio buttons.
This code raises error
<txp:mem_form_radio name="radio1" value="1" />
<txp:mem_form_radio name="radio1" value="2" />
Value is unknown to the plugin. How do I pass values from the radio group?
Thanksss…
Offline
Re: mem_form - Generic HTTP form processing
Due to the need to upload a file with my contact form I came across mem_form. Now I am stuck and in need of some help :-)
I want to use a single form to have someone send me a form with some info and a file. I squeeze this into a misc form that I call directly from a page using the output_form tag. It does not work and I need some assistance. What I want to do is to (optionally) take a picture and the rest of the input and send it directly to me via email. I guess I need to adjust the php part, right? But how?
<txp:php>
register_callback('mem_file_form_submitted', 'mem_form.submit');
function mem_file_form_submitted()
{
global $mem_form_values;
dmp($mem_form_values);
foreach($mem_form_values as $k=>$v)
{
// find the uploaded temp file and delete it
if (is_array($v) && isset($v['tmp_name']) && file_exists($v['tmp_name']))
unlink($v['tmp_name']);
}
}
function mem_file_form($atts,$thing='')
{
return mem_form(array('type'=>'file-form', 'enctype'=>'multipart/form-data'),$thing);
}
</txp:php>
<!-- contribute_form -->
<txp:mem_form type="form">
<txp:mem_form_text label="Your name" />
<txp:mem_form_email label="Your Email" />
<txp:mem_form_text label="Your age" />
<txp:mem_form_textarea label="Your Story" />
<txp:mem_form_file name="myfile" label="Your picture" />
<txp:mem_form_submit label="Send" />
</txp:mem_form>
Yoko for Textpattern – A free blog theme • Minimum Theme – If all you want to do is write.
Note: I am currently not actively using Textpattern, so I am not in the forums very often
Offline
#97 2012-06-28 11:25:03
- tom1
- Member
- Registered: 2009-03-20
- Posts: 36
Re: mem_form - Generic HTTP form processing
has anybody made a form which would add multiple articles into TXP from public side? Probably could use mem_moderation_article also. I’ve done quick tests with raw php parsing the form and inserting everything to txp_moderation, but i’d prefer a bit cleaner way, if its possible :)
futher more, any experiments posting data with AJAX?
Last edited by tom1 (2012-06-28 13:57:18)
Offline
Re: mem_form - Generic HTTP form processing
I am using mem_form_text and mem_form_textarea to render fileds.
Now, I am trying to get placeholder=“some Text” into the fields.
<input type="text" placeholder="Fill me …">
Is that possible?
Offline
Re: mem_form - Generic HTTP form processing
If it’s not possible natively, you can alter any attribute with etc_query:
<txp:etc_query data='<txp:mem_form_textarea label="Your Story" />'
replace="//textarea@@placeholder=Fill me..." />
Offline
#100 2015-09-16 13:50:08
Re: mem_form - Generic HTTP form processing
Nice plugin. I see, it can be come in quite handy.
Unfortunately, I am receiving an error:
Tag error: <txp:etc_query data=’<txp:mem_form_textarea label=“Your Story” />’ replace=”//textarea@@placeholder=Fill me…” /> -> Warning: DOMDocument::saveHTML() expects exactly 0 parameters, 1 given while parsing form None on page add
I am running Textpattern 4.5.7.
Offline
#101 2015-09-16 13:53:36
Offline
#102 2015-09-16 14:15:05
- uli
- Moderator

- From: Cologne
- Registered: 2006-08-15
- Posts: 4,316
Re: mem_form - Generic HTTP form processing
etc wrote #294894:
Unfortunately, it needs php 5.3 at least.
If that’s not an option, mjut, I think I remember using rah_replace for adding placeholder values.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#103 2016-04-24 08:22:38
Re: mem_form - Generic HTTP form processing
Hi Guys,
need to have a hint if possible.
I want to use mem_form to collect data that serve to generate a pdf document using dompdf, but the constraint is the url that used to generate the pdf is different from the form url, i thinked to use the redirect option of mem_form, but then how to get the data?
Right now i use a normal form putting the pdf url on the action, and using $_POST array to retreive data.
Thanks for your hints if any.
Offline
#104 2020-12-20 16:33:22
- ovekaaven
- New Member
- Registered: 2017-02-27
- Posts: 2
Re: mem_form - Generic HTTP form processing
The download links for this have been broken for a while. Is there a current alternative? I just need something to handle the basics of web security for me, such as nonces to prevent cross-site attacks.
The only thing I’ve found so far in the way of alternatives is com_connect, where it might be possible to override the delivery callback and e.g. look at the subject to figure out which form was submitted and handle it accordingly, I might do that if necessary, but obviously a proper form plugin would be preferable.
Last edited by ovekaaven (2020-12-21 19:44:52)
Offline
#105 2020-12-20 18:23:08
Re: mem_form - Generic HTTP form processing
I have a copy I’m hacking for recent versions of Textpattern. I’ll try and dig it out today or tomorrow and get it to you.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline