ChronoEngine Forums
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Using form variables in subject, and email body (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Using form variables in subject, and email body
#6942
MasterC (User)
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Using form variables in subject, and email body 1 Month, 2 Weeks ago Karma: 0  
Hi,

I've got a form that requests information from our student and emails it to our advisors. For now this function is all I'm working on, later I'd like to instead be able to save it to a database and email a link of the saved form instead of the contents of the form. I'm interested in how I should use form data for email variables. I have seen this thread: http://www...;id=5672&catid=2

And I've seen the tutorial, but I must be missing something "obvious" somewhere. I have these fields in my Form HTML:
Code:

<td>Name:</td> <td colspan="3"><input name='name' type='text' size="30" /></td> </tr> <tr> <td>Student ID: </td> <td colspan="3"><input name='studentID' type='text' size="20" /></td> </tr> <tr> <td>Email address: </td> <td colspan="3"><input name='email' type='text' size="40" /></td>
I'll be transforming it to a CSS-based layout later, so please just ignore the table formatting for now And then in the second tab called "Special Fields" I have subject name and email in the corresponding fields. Then in the next tab in the OnSubmit before email is sent I have the following PHP code:
Code:

<?php $_POST['subject'] = "Major Status application for" $_POST['name'] ?>
Yet when I fill out the form with a name, ID and email address, I only get the name and email variables working (they show up in the From line); the subject is always blank. If I remove the OnSubmit code, the special fields "subject" and put something in the General subject box, it gets passed through appropriately. Is it something wrong with my PHP code? Any help would be appreciated! -Chad
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#6957
GreyHead (Admin)
Admin
Posts: 2115
graph
User Offline Click here to see the profile of this user
Re:Using form variables in subject, and email body 1 Month, 2 Weeks ago Karma: 41  
Hi Chad,

The problem is that ChronoForms doesn't know that you are creating a field called 'subject'. Add a hidden field to your form:
Code:

<input type="hidden' name="subject" value="" />
Then ChronoForms will create a placeholder that will be filled in by your OnSubmit code. Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#7001
MasterC (User)
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Re:Using form variables in subject, and email body 1 Month, 1 Week ago Karma: 0  
Thank you! You did mention that in the above referenced thread, I guess I just didn't see it or understand what it did enough to pay attention to that. Thanks again!

-Chad
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#7037
MasterC (User)
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Re:Using form variables in subject, and email body 1 Month, 1 Week ago Karma: 0  
I must have some typo that I'm not seeing, but I still cannot seem to get a subject when I use variables from my form. Just to recap what I've done:

In the General section:
Subject: subject
From Email: email
From name: name

In the Special Fields section:
subject field: subject
From email field: email
From name field: name

In the HTML of my form:
Code:

<input type="hidden" name="subject" value="" /> <label for="name">Name:</label><input name='name' id='name' type='text'/> <label for="studentID">Student ID:</label><input name='studentID' id='studentID' type='text' /> <label for="email">Email address:</label><input name='email' id='email' type='text' />
And when I feel out my form and hit submit, the subject field of my email is still blank. Any ideas? Thanks! -Chad
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#7040
GreyHead (Admin)
Admin
Posts: 2115
graph
User Offline Click here to see the profile of this user
Re:Using form variables in subject, and email body 1 Month, 1 Week ago Karma: 41  
Hi chad,

Do you have the other code in the 'OnSubmit before' box?

Bob
 
Report to moderator   Logged Logged  
 
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
  The administrator has disabled public write access.
#7042
MasterC (User)
Fresh Boarder
Posts: 6
graphgraph
User Offline Click here to see the profile of this user
Re:Using form variables in subject, and email body 1 Month, 1 Week ago Karma: 0  
Yes I do, thanks for asking.

Onsubmit before email is sent:
Code:

<?php $_POST['subject'] = Intermediate Status application for $_POST['name'] ?>
And I've tried with and without quotes around my text:
Code:

<?php $_POST['subject'] = "Intermediate Status application for" $_POST['name'] ?>
Thanks! -Chad Post edited by: MasterC, at: 2008/03/28 02:01

Post edited by: MasterC, at: 2008/03/28 02:02
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop


equalheight If you have any questions you can post to our forums and we will be glad to help ASAP

Members Login






Lost Password?
No account yet? Register

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com

ChronoForms License

equalheightTo be able to continue working at this component we decided to get a small profit out of it but at the same time don't force everybody to pay in order to use this great component.

 

 From version 1.5 and up a link at the bottom of everyform created will be placed, saying "joomla professional work", the link will be to us here htttp://www.chronoengine.com, its illegal to remove this link from the source code unless you have a license,

so the license is very simply for the same ChronoForms component without a link, thats all!

This License is for 5 different websites ONLY. 

 

 However, in order to allow everybody to still use the component and even get out of this, the link is inside a div with class : chronoform , use this to hide the link by using different colors or whatever if you really can't pay, but of course the link is still exists at your page source.

 

The license is ONLY 25$ can be bought here :

 

Thank you!

 

ChronoEngine.com Team 

Joomla Templates and Joomla Tutorials