Textpattern Forum

You are not logged in. Register | Login | Help

#11 2009-02-10 05:03:00

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_simple_form

Version 0.3 is now released.

You may now specify a “success_form”. Tags have been provided to output and compare posted values. See plugin help for full details.

Offline

#12 2009-02-10 13:31:36

velograph
Member
From: Oregon
Registered: 2007-03-25
Posts: 9

Re: mem_simple_form

Thanks for the reply Manfre.

I’m gonna look into that.

Last edited by velograph (2009-02-11 01:58:29)

Offline

#13 2009-02-11 01:58:45

velograph
Member
From: Oregon
Registered: 2007-03-25
Posts: 9

Re: mem_simple_form

I don’t have too much experience working with plugins, so forgive me if this is a dumb question. I’ve been using zem_contact and a few others on my sites with no need to alter/add/change a thing. This is new territory for me.

Would I be adding my javascript into the form itself? Say right in <txp:mem_form_submit javascript entered here /> ?

I was thinking the simplest way of acheiving what I want would be to have an onclick event that sends the user one of two places.

Or would I need to add that into the plugin where the submit button is defined? This seems rather unlikely, but then again, I’m fairly new.

I’m posting this javascript question here because it deals with adding it to a plugin. I hope that’s not taboo.

Offline

#14 2009-02-11 02:25:14

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: mem_simple_form

Jason, you can use the newly added success_form. In the success_form, you could use <txp:mem_simple_ps name="mem_form_submit" /> to set a javascript variable.

Offline

#15 2009-02-21 01:07:36

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_simple_form

I would like to redirect the user after the form has been submitted. It appears that I need to use success_form to accomplish this, however, I have attempted virtually every combination of tag syntax and am unable to get it to work under TxP 4.0.8.

The following tag syntax is the only one that does not throw tag errors on page load:

<txp:mem_simple_form table="txp_test_users" name="success_form_test_success" />

There is one exception. I am required to identify a table. I assume that I am supposed to identify the txp_form table to properly find the form I want to have displayed after the HTML form is submitted. Unfortunately, I get an error stating that “no data was submitted with form”.

If I remove the success form tag, it works as expected and properly writes to the database. I think I must have the success_form syntax wrong but every other combination seems to throw a tag error. I have even tried variations using the mem_form tag since there are examples of that in the plugin description and mem_simple_form relies on that plugin to function.

Can someone please post an example of what the complete success tag should look like so that I may correct mine or I can compare to see if I should be looking at some other cause for the failure of my form.

Thx,

cpk

Offline

#16 2009-02-26 02:03:32

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_simple_form

Solved my own problem. Now it seems quite obvious what I did wrong. For others who may have also had problems, here is the solution: I thought the success_form was invoked by using the name attribute as I posted above. The following is an example of the proper way to redirect to a success_form after your mem_simple_form is submitted.

<txp:mem_simple_form table="txp_test_users" id_field="user_id" id_insert="0" success_form="mem_simple_test_success" >

cpk

Offline

#17 2009-02-26 02:13:53

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_simple_form

So, I now have this working to take user input, post it to a specific DB table and redirect the user to the downloadable content they are seeking in exchange for their email address.

However, I would like the user to continue to have access to the downloadable content during the remainder of the browser session without the need to re-enter their information to gain access. Even better would be the option to save info to a cookie that would provide users who have already provided their information the ability to access the downloads during subsequent browser sessions.

Does anyone have any recommendations to accomplishing this with mem_simple_form with or without additional plugins or will this kind of feature need to be custom coded?

Thanks,

cpk

Offline

#18 2009-02-26 08:13:38

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,895
Website

Re: mem_simple_form

You could use chs_cookie to write a cookie on reaching the success form, and check for this cookie before presenting the form.


TXP Builders – finely-crafted code, design and txp

Offline

#19 2009-02-27 03:53:52

cpk
Member
Registered: 2005-08-07
Posts: 62

Re: mem_simple_form

Jakob,

This looks like what I am looking for but I can’t test it since it seems that his server is not allowing public access for download. Any other sources for chs_cookie download?

Thanks,

cpk

Offline

#20 2009-02-27 04:11:22

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 819
Website

Re: mem_simple_form

Offline

Board footer

Powered by FluxBB