hey,
i would like to make a version of the contactform that has only 1 field: email address. i’ve poked around the snippet code and i can edit the html stuff no problem, but i don’t know how to edit the php. i did try deleting some lines that referred to sender name, message and so forth, but nothing has worked yet (not surprising since whatever i’m trying is just a shot in the dark). fyi, the contactform in its unedited form works perfectly fine.
thanks,
arp
Sorry - not using ModX anymore 01/01/2007
-
☆ A M B ☆
- 24,524 Posts
Check out the eForm snippet. You can make any kind of form you want. I use it for everything.
thanks - i did find it and it seemed way more feature-packed than i needed, but better to learn a new skill.
Sorry - not using ModX anymore 01/01/2007
-
☆ A M B ☆
- 24,524 Posts
Using the original eForm (not eFormParse, which is much easier) I have this snippet call:
[!eForm? &formid=`ContactForm` &to=`[email protected]` &replyto=`email` &tpl=`ContactForm` &report=`ContactReport` &subject=`Web Contact` &format=`name:Name:string:1,email:Email:email:1,message:Message:html:1`!]
and my template (&tpl=`ContactForm`) looks like this:
<span style="color:red">[+validationmessage+]</span>
<form method="post" action="" enctype="multipart/form-data">
<fieldset id="cfSet">
<input name="formid" type="hidden" value="ContactForm"/>
<label for="cfName">Name:
<input name="name" id="cfName" class="text" type="text" value="[+name+]" />
</label>
<label for="cfEmail">Email:
<input name="email" id="cfEmail" class="text" type="text" value="[+email+]" />
</label>
<label for="cfMessage">Message: <br />
<textarea name="message" id="cfMessage" rows="4" cols="20">[+message+]</textarea>
</label>
<input type="submit" name="contact" id="cfContact" class="button" value="Send Message" />
</fieldset>
</form>
partially working so far - using the default snippet & your call (minus the ContactReport stuff), i’m receiving empty messages, no content regarding email address, name or message. still have work to do, obviously, but i’ll check out eform parser and see.
Sorry - not using ModX anymore 01/01/2007
-
MODX Staff
- 12,272 Posts
The ContactReport is what formats the outgoing messages, so I’d expect it to be blank if you’re not using it.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
hmm - i’m assuming that without a ContactReport chunk that nothing would work? also, should the reply-to email be the one the of the person sending the message or the default email for the site?
Sorry - not using ModX anymore 01/01/2007
-
MODX Staff
- 12,272 Posts
Just the message would be blank when omitting the report as it’s what is used to build the body of the message. Reply-to is your preference.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
ok - i created a ContactReport chunk, got it working and can finally get to formatting and figuring out how to redirect to a Thank You page (rather than an html success message).
thanks to y’all for helping me see the light
Sorry - not using ModX anymore 01/01/2007
-
☆ A M B ☆
- 24,524 Posts
I’m sorry... I forgot to include my report form! ContactReport chunk:
<h3>Contact Input</h3>
<strong>Name:</strong> [+name+]<br />
<strong>Email:</strong> [+email+]<br />
<strong>Message:</strong> [+message+]
Use the &gotoid argument in the snippet call to set the document to go to after sending mail.