Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-18 17:53:12

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Creating a contact form that writes to the database and sends email

I’m using zem_contact_reborn for a feedback form on a site, and what I’d like to do is, in addition to having the user input emailed to whoever is listed on the form, I’d like to have the user input written to the database so that it can be pulled, sorted, etc. to my heart’s content.

Has this been done before? Could anyone point me to a post or a plugin or something that might get me headed in the right direction? If not, any ideas on what’s the best way to go about it? I like the security and spam-freeness of zem_contact, but I’m open to using a different approach, as long as I don’t end up with a database/inbox full of garbage.

Last edited by frickinmuck (2011-07-18 17:53:45)


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#2 2011-07-18 18:50:49

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

You could have a look here

I am not sure which one, you can use this link as a reference so you can search here on the forum.

Good luck with the minor documentation :P


<txp:way_too_cool />

Offline

#3 2011-07-18 18:53:45

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

One time I gave up setting up attachment with the contact form… I stumbled this

Link

I use this alongside with textpattern with extra database. This may help you if you cant find any solution


<txp:way_too_cool />

Offline

#4 2011-07-18 18:53:47

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

Re: Creating a contact form that writes to the database and sends email

Thanks! I actually stumbled across this, which is looking promising. I’ll let you know how it works out.


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#5 2011-07-18 18:56:28

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

The link you send me is interesting, but have a look at the first comment. its all in the first link I sent you


<txp:way_too_cool />

Offline

#6 2011-07-18 20:15:52

lithium002
Member
Registered: 2011-04-29
Posts: 25

Re: Creating a contact form that writes to the database and sends email

Hey,

I’m having a little trouble with the radio buttons. Basically, when you output a radio button with zem_contact, it comes with its own “value” field. How can I change this value field to what I want?

Offline

#7 2011-07-18 20:54:51

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

Link

Group and label parameters are required

<txp:zem_contact_radio label="something" group="Something group" />
<txp:zem_contact_radio label="something" />
<txp:zem_contact_radio label="something" />


<txp:zem_contact_radio label="Medium" group="I like my steak" />
<txp:zem_contact_radio label="Rare" />
<txp:zem_contact_radio label="Well done" />

<txp:way_too_cool />

Offline

#8 2011-07-18 21:23:40

lithium002
Member
Registered: 2011-04-29
Posts: 25

Re: Creating a contact form that writes to the database and sends email

Hey Dimitri,

Thanks for that info, however, the problem is the field ‘value’ associated with each radio button that is generated automatically by the plugin.

I’m trying to get the value associated with a radio button, which would either be a 0 or a 1, and use those values to perform different functions, however, there seems to be no field ‘value’ assigned to a radio button and the one generated by the form is a big string of random characters that changes each time.

Any way to work around this problem?

Offline

#9 2011-07-18 21:52:01

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

Not sure what you trying to say. Could you show me your code and the source code.


<txp:way_too_cool />

Offline

#10 2011-07-18 21:58:13

lithium002
Member
Registered: 2011-04-29
Posts: 25

Re: Creating a contact form that writes to the database and sends email

<p>Are you checked??</p> <p><txp:zem_contact_radio group="Check" label="Yes" checked="1" /><br /> <txp:zem_contact_radio group="Check" label="No" /></p>

brings up :

<p>Are you checked?</p> <p><input value="q7b7508b0cf15ec0b96a56426f4ec8296" type="radio" id="q7b7508b0cf15ec0b96a56426f4ec8296" class="zemRadio" checked="checked" /> <label for="q7b7508b0cf15ec0b96a56426f4ec8296" class="zemRadio">Yes</label><br /> <input value="q685c620ff5e57ec429ad8ccfbd447b7a" type="radio" id="q685c620ff5e57ec429ad8ccfbd447b7a" class="zemRadio" /> <label for="q685c620ff5e57ec429ad8ccfbd447b7a" class="zemRadio">No</label></p>

The value changes randomly. Is there anyway to assign a custom value to radio buttons?

Offline

#11 2011-07-18 22:11:48

Dimitri
Member
From: Johannesburg
Registered: 2010-10-31
Posts: 129

Re: Creating a contact form that writes to the database and sends email

I just remembered, zem does add random values. I dont think you need to worry about it, the plugin will automatically pick up the selected radio and will send the label value through the email.

I saw a small error in your tag, you added two groups… but it wont make a different
<p>Are you checked??</p> 
<p>
	<txp:zem_contact_radio group="Check" label="Yes" checked="1" />
	<txp:zem_contact_radio label="No" />
</p>

Last edited by Dimitri (2011-07-18 22:12:57)


<txp:way_too_cool />

Offline

#12 2011-07-19 14:42:38

lithium002
Member
Registered: 2011-04-29
Posts: 25

Re: Creating a contact form that writes to the database and sends email

Hey Dimitri,

I know it sends out the actual value in the email, however, I need the value before it is sent out for other purposes. :(

Offline

Board footer

Powered by FluxBB