Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#91 2012-03-20 17:40:21

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

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

#92 2012-03-21 09:08:52

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

Re: mem_form - Generic HTTP form processing

Just found the missing thing, it’s type

Offline

#93 2012-04-12 19:02:28

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

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

#94 2012-04-12 22:21:22

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

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

#95 2012-04-13 08:58:25

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

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

#96 2012-05-03 12:19:57

stephan
Plugin Author
From: Bochum, Germany
Registered: 2004-07-26
Posts: 196
Website

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 themeMinimum 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

#98 2015-09-16 11:23:31

mjut
Member
Registered: 2009-07-16
Posts: 32
Website

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

#99 2015-09-16 11:30:48

etc
Developer
Registered: 2010-11-11
Posts: 5,681
Website GitHub

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

mjut
Member
Registered: 2009-07-16
Posts: 32
Website

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

etc
Developer
Registered: 2010-11-11
Posts: 5,681
Website GitHub

Re: mem_form - Generic HTTP form processing

mjut wrote #294892:

I am running Textpattern 4.5.7.

Unfortunately, it needs php 5.3 at least.

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

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,559
Website GitHub Twitter

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,476
Website GitHub

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

Board footer

Powered by FluxBB