Hi,
I ran through these forums but didn't find the exact answer to my question.
I want to do the following:
[list]1. Manually put a link on several of my article pages to a ChronoForm (not all of them, so I don't want to implement the link in my template)
2. Have the title from the article the user came from put in a form field[/list]
So, when filling out the inquiry form, the user can see the subject line is the same as the article title he was on.
I really need the custom code to catch the article title and fill the form field. Can anyone help me out?
I hope this makes sense and of course I hope to get an answer🙂.
Kind regards,
Maurice
I ran through these forums but didn't find the exact answer to my question.
I want to do the following:
[list]1. Manually put a link on several of my article pages to a ChronoForm (not all of them, so I don't want to implement the link in my template)
2. Have the title from the article the user came from put in a form field[/list]
So, when filling out the inquiry form, the user can see the subject line is the same as the article title he was on.
I really need the custom code to catch the article title and fill the form field. Can anyone help me out?
I hope this makes sense and of course I hope to get an answer🙂.
Kind regards,
Maurice
Hi Maurice,
If you ae adding the links manually add the article id to the link url then look up the title in the Form HTML.
Bob
If you ae adding the links manually add the article id to the link url then look up the title in the Form HTML.
Bob
Thanks Bob,
Let's say I want this slightly more automated, since there seem to be over a hundred product pages (I didn't know before, sorry).
What if I put a module with a generic link on every product page in my site (thus not on all other pages)? Is it possible to hand over the article title to the form automatically?
I do hope so...
Thanks in advance,
Maurice
Let's say I want this slightly more automated, since there seem to be over a hundred product pages (I didn't know before, sorry).
What if I put a module with a generic link on every product page in my site (thus not on all other pages)? Is it possible to hand over the article title to the form automatically?
I do hope so...
Thanks in advance,
Maurice
Hi Maurice,
In the Form HTML you can check the page url to get the article id
Bob
In the Form HTML you can check the page url to get the article id
<?php
if ( !$mainframe->isSite() ) { return; }
$article_id = JRequest::getInt('id', 0, 'get');
. . .
?>
Bob
Thanks again but...
Can you be somewhat more specific on how to implement this?
I already put this code on top of all HTML code.
But how do I get the article title in my textbox?
I assume by: value=""
I don't know how to do this.
Can you be somewhat more specific on how to implement this?
I already put this code on top of all HTML code.
But how do I get the article title in my textbox?
I assume by: value=""
I don't know how to do this.
Hi Maurice,
The full code will be something like this
Bob
The full code will be something like this
<?php
if ( !$mainframe->isSite() ) { return; }
$article_id = JRequest::getInt('id', 0, 'get');
$title = '';
if ( $article_id ) {
$db =& JFactory::getDBO();
$query = "
SELECT `title`
FROM `#__content`
WHERE `id` = ".$db->quote($article_id)." ;
";
$db->setQuery($query);
$title = $db->loadResult();
}
echo $title;
?>
Bob
Hi Bob (and others),
Thanks!
I have tried implementing this code but I'm afraid I'm not so good with coding... It didn't work. I probably copied it in the wrong place. 😶
Could anyone please help me with some guidelines on how to implement this?
What I have so far:
1. the form, with a text field called 'Subject'
2. a custom HTML module with a hyperlink to the form
3. this module appears on all product pages
So, I need some help with how the link in the module passes through the Article Title to the Subject field.
Thanks in advance
Thanks!
I have tried implementing this code but I'm afraid I'm not so good with coding... It didn't work. I probably copied it in the wrong place. 😶
Could anyone please help me with some guidelines on how to implement this?
What I have so far:
1. the form, with a text field called 'Subject'
2. a custom HTML module with a hyperlink to the form
3. this module appears on all product pages
So, I need some help with how the link in the module passes through the Article Title to the Subject field.
Thanks in advance
Hi all,
Understanding the rist of getting annoying...😶 But... I really would like to ask you to help me with this!
Pls read this thread and I'm looking forward to your answer.
Maurice
Understanding the rist of getting annoying...😶 But... I really would like to ask you to help me with this!
Pls read this thread and I'm looking forward to your answer.
Maurice
Hi Maurice,
There's not much to do. Add the code I had before into the Form HTML box but change the last line to put the title into a hidden input:
Bob
There's not much to do. Add the code I had before into the Form HTML box but change the last line to put the title into a hidden input:
<?php
if ( !$mainframe->isSite() ) { return; }
$article_id = JRequest::getInt('id', 0, 'get');
$title = '';
if ( $article_id ) {
$db =& JFactory::getDBO();
$query = "
SELECT `title`
FROM `#__content`
WHERE `id` = ".$db->quote($article_id)." ;
";
$db->setQuery($query);
$title = $db->loadResult();
}
?>
<input type='hidden' name='title' id='title' value='<?php echo $title; ?>' />
Bob
Hi Bob,
Thanks for your reply! I really appreciate it.
I pasted your code into the HTMLform field (above the existing form code) and I get an error:
com_chronocontact\admin.chronocontact.php(2736) : eval()'d code on line 6
Maybe you can help me out?
Thanks for your reply! I really appreciate it.
I pasted your code into the HTMLform field (above the existing form code) and I get an error:
com_chronocontact\admin.chronocontact.php(2736) : eval()'d code on line 6
Maybe you can help me out?
Hi Maurice,
This line should end with a semi-colon
Bob
This line should end with a semi-colon
$db =& JFactory::getDBO();
I'll fix my original posts.Bob
Thanks again! Problem solved.
I want to put the link to the form in a module.
This is the link to the form:
index.php?option=com_chronocontact&chronoformname=inforequestTEST
Can you tell me how I add the ID to this link, so this will be passed through to the form?
I want to put the link to the form in a module.
This is the link to the form:
index.php?option=com_chronocontact&chronoformname=inforequestTEST
Can you tell me how I add the ID to this link, so this will be passed through to the form?
Hi Maurice,
You could just put this code into a mini=form in the module
Bob
You could just put this code into a mini=form in the module
<?php
if ( !$mainframe->isSite() ) { return; }
$article_id = JRequest::getInt('id', 0, 'get');
$title = '';
if ( $article_id ) {
$db =& JFactory::getDBO();
$query = "
SELECT `title`
FROM `#__content`
WHERE `id` = ".$db->quote($article_id)." ;
";
$db->setQuery($query);
$title = $db->loadResult();
}
?>
<div><a href='index.php?option=com_chronocontact&chronoformname=inforequestTEST&title=<?php echo $title; ?>' >Click here</a>
Bob
Thanks Bob,
I am getting your point but unfortunately I can't get it to work the way I want.
The Title parameter adds dynamically to the link but when the form opens, It looks like the parameter is lost.
Maybe you could take a quick look at the front-end here.
You will find the module with the link at the bottom of the screen.
http://www.webcase-development.nl/_clients/ADEON-P20101243/index.php?option=com_content&view=article&id=119&Itemid=151
Thanks!!
I am getting your point but unfortunately I can't get it to work the way I want.
The Title parameter adds dynamically to the link but when the form opens, It looks like the parameter is lost.
Maybe you could take a quick look at the front-end here.
You will find the module with the link at the bottom of the screen.
http://www.webcase-development.nl/_clients/ADEON-P20101243/index.php?option=com_content&view=article&id=119&Itemid=151
Thanks!!
Hi Maurice,
When you say it gets lost . . . I can't see where you are trying to capture it? In the hidden input named 'Subject'?
What code are you using for this?
Bob
When you say it gets lost . . . I can't see where you are trying to capture it? In the hidden input named 'Subject'?
What code are you using for this?
Bob
Goodmorning Bob,
Thanks for having a look again!
I'll try to explain what code I used and where.
First of all, I have a module with the following code. This module you find at the bottom of the product page.
This links to the Chronoform inforequestTEST.
This form was built with the help of the wizard (awesome tool!). Later on, I added a piece of code you provided.
Here's all the form code:
I would like the Title (product page) to appear in the form so the customer doesn't have to fill that out here. And the Title has to appear in the e-mail that is sent to my client.
Thanks for having a look again!
I'll try to explain what code I used and where.
First of all, I have a module with the following code. This module you find at the bottom of the product page.
<?php
if ( !$mainframe->isSite() ) { return; }
$article_id = JRequest::getInt('id', 0, 'get');
$title = '';
if ( $article_id ) {
$db =& JFactory::getDBO();
$query = "
SELECT `title`
FROM `#__content`
WHERE `id` = ".$db->quote($article_id)." ;
";
$db->setQuery($query);
$title = $db->loadResult();
}
?>
<div><a href='index.php?option=com_chronocontact&chronoformname=inforequestTEST&title=<?php echo $title; ?>' >Click here</a> to send us a request about<?php echo $title; ?>.
This links to the Chronoform inforequestTEST.
This form was built with the help of the wizard (awesome tool!). Later on, I added a piece of code you provided.
Here's all the form code:
<input type='hidden' name='Subject' id='title' value='<?php echo $title; ?>' />
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text">Information Request: <?php echo $title; ?></h1>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 110px;">Company name</label>
<input class="cf_inputbox required" maxlength="150" size="20" title="" id="text_1" name="company" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 110px;">Name</label>
<input class="cf_inputbox required" maxlength="150" size="20" title="" id="text_2" name="cust_name" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 110px;">Email adress</label>
<input class="cf_inputbox required validate-email" maxlength="150" size="20" title="" id="text_7" name="cust_email" type="text" />
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textarea">
<label class="cf_label" style="width: 110px;">Comment</label>
<textarea class="cf_inputbox" rows="5" id="text_6" title="" cols="30" name="comment"></textarea>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_captcha">
<label class="cf_label" style="width: 110px;">Verification</label>
<span>{imageverification}</span>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_5" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
I would like the Title (product page) to appear in the form so the customer doesn't have to fill that out here. And the Title has to appear in the e-mail that is sent to my client.
Hi Maurice,
There's nothing in the Form HTML to *get* the value of $title. Please add this at the beginning:
Bob
There's nothing in the Form HTML to *get* the value of $title. Please add this at the beginning:
<?php
if ( !$mainframe->isSite() ) { return; }
$title = JRequest::getString('title', '', 'get');
?>
Bob
Hi,
I am using the same form for 50 different articles. I need the form to be sent containing some field which has the article name. i used chronoform module in article. then assign this url "index.php?option=com_content&view=article&id=270&Itemid=39" in 50 diffrent articles.I used following code
<table width="500" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="200" valign="top">Vacature-naam</td>
<td valign="top">
<?php
$database =& JFactory::getDBO();
$query = "SELECT * FROM #__content WHERE id='".JRequest::getVar('id')."'";
$database->setQuery( $query );
$article = $database->loadObject();
echo $article->title;
?>
<input type="hidden" name="vacature" value="<?php echo $article->title; ?>" />
</td>
</tr>
</table>
but this code is not working bcoz it sending module article name.
Some guy here know how can I do this?
Please help me sorting this problem. its very urgent
I am using the same form for 50 different articles. I need the form to be sent containing some field which has the article name. i used chronoform module in article. then assign this url "index.php?option=com_content&view=article&id=270&Itemid=39" in 50 diffrent articles.I used following code
<table width="500" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="200" valign="top">Vacature-naam</td>
<td valign="top">
<?php
$database =& JFactory::getDBO();
$query = "SELECT * FROM #__content WHERE id='".JRequest::getVar('id')."'";
$database->setQuery( $query );
$article = $database->loadObject();
echo $article->title;
?>
<input type="hidden" name="vacature" value="<?php echo $article->title; ?>" />
</td>
</tr>
</table>
but this code is not working bcoz it sending module article name.
Some guy here know how can I do this?
Please help me sorting this problem. its very urgent
@smartsak,
Please carefully follow the instructions Bob gave in this thread, because it solved the exact same issue I had!
In my case, I also needed the article title to be put in the subject field of the form.
Please carefully follow the instructions Bob gave in this thread, because it solved the exact same issue I had!
In my case, I also needed the article title to be put in the subject field of the form.
Hi
My form is working fine. But problem is that when i submitting form, in email preloaded value is not showing in front text area. i am attaching screen shot of form & mail. Please see it. Please help me sorting this problem. its very urgent
My form is working fine. But problem is that when i submitting form, in email preloaded value is not showing in front text area. i am attaching screen shot of form & mail. Please see it. Please help me sorting this problem. its very urgent
Hi smartsak,
It looks as though you have some PHP in the Email Template that is being carried over into the email body. Not sure why this is. Does the missing <?php if ( exist in the template?
What's more the PHP doesn't look as though it belongs in the template at all.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
It looks as though you have some PHP in the Email Template that is being carried over into the email body. Not sure why this is. Does the missing <?php if ( exist in the template?
What's more the PHP doesn't look as though it belongs in the template at all.
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
Hi smartsak,
There is some junk at the start of the Email template.
Bob
There is some junk at the start of the Email template.
<!--?php if ( !$mainframe--->
<p>isSite() ) { return; } $title = JRequest::getString('title', '', 'get'); if ( !$mainframe->isSite() ) { return; } $alias = JRequest::getString('alias', '', 'get'); ?> {Subject}' /> {Subject1}' /></p>
Go to the Email Setup tab, and in the Email Properties box set Use template Editor to No. Then go back to the template and clean up the code there.Bob
hi Bob,
Thanks for quick reply. where I put these code
After clean up the code from template, now it is not showing in email. But the following heads are blank in mail. how to show form data in front of these text.
Gewählte Prämie:
Prämien Nr:
Thanks
Shahzad
Thanks for quick reply. where I put these code
<!--?php if ( !$mainframe--->
<p>isSite() ) { return; } $title = JRequest::getString('title', '', 'get'); if ( !$mainframe->isSite() ) { return; } $alias = JRequest::getString('alias', '', 'get'); ?> {Subject}' /> {Subject1}' /></p>
After clean up the code from template, now it is not showing in email. But the following heads are blank in mail. how to show form data in front of these text.
Gewählte Prämie:
Prämien Nr:
Thanks
Shahzad
Hi Bob,
Thanks for your quick response. Problem resolved. But I want own css for form design. can u help me in this.
Thanks
Shahzad
Thanks for your quick response. Problem resolved. But I want own css for form design. can u help me in this.
Thanks
Shahzad
Hi Shazad,
The PHP snippet looks like junk to me so I'm not clear what it is meant to be doing. It should probably go in the OnSubmit Before Email box.
You need to add {input_name} in the template to show the values returned from the form with the name of the input inside the curly brackets.
You can add your own CSS in the Form CSS box.
Bob
PS I notice that some of your input names have dashes in them e.g name="la-plz". This will probably cause problems please replace them with underscores e.g. name="la_plz".
PPS You need to sort out the difference between PHP tags <?php . . .?> and HTML comments <!-- . . . --> you have some very odd hybrid tags in your email template <!--?php echo $title; ?-->. These will not work.
The PHP snippet looks like junk to me so I'm not clear what it is meant to be doing. It should probably go in the OnSubmit Before Email box.
You need to add {input_name} in the template to show the values returned from the form with the name of the input inside the curly brackets.
You can add your own CSS in the Form CSS box.
Bob
PS I notice that some of your input names have dashes in them e.g name="la-plz". This will probably cause problems please replace them with underscores e.g. name="la_plz".
PPS You need to sort out the difference between PHP tags <?php . . .?> and HTML comments <!-- . . . --> you have some very odd hybrid tags in your email template <!--?php echo $title; ?-->. These will not work.
Hi Bob,
I need your help. I have created form. Where user fill information. there are three validation field
1. Name
2. telefon
3. email.
but when user fill Kundennummer(customer id) field, then he doesn't need fill any field of form. I am using inputbox required class of joomla.
I am attaching screenshot of form. please see it.
Please help, its very urgent.
Thanks
Shahzad
I need your help. I have created form. Where user fill information. there are three validation field
1. Name
2. telefon
3. email.
but when user fill Kundennummer(customer id) field, then he doesn't need fill any field of form. I am using inputbox required class of joomla.
I am attaching screenshot of form. please see it.
Please help, its very urgent.
Thanks
Shahzad
Hi Shazad,
I looks to me as though you have built this form yourself and you are not using ChronoForms?
Bob
I looks to me as though you have built this form yourself and you are not using ChronoForms?
Bob
Hi Bob
Select An Item from dropdown, Other Get Automatically Selected in multiple selection box in form.
Please help
Thanks
Shahzad
Select An Item from dropdown, Other Get Automatically Selected in multiple selection box in form.
Please help
Thanks
Shahzad
Hi Shahzad,
I'm very sorry but these are the ChronoForms forums; as you aren't using ChronoForms you are at the bottom of my list of questions to answer. It's unlikely that I will have the time to help you in the near future.
Bob
I'm very sorry but these are the ChronoForms forums; as you aren't using ChronoForms you are at the bottom of my list of questions to answer. It's unlikely that I will have the time to help you in the near future.
Bob
Hi Bob
like to add subscription services in chronoform. Here's what I envision: ... would like a confirmation email sent to the user with ... like the ability to send reminder notices to customers. ... customize the subscription form so I can capture specific.
Thanks
Shahzad
like to add subscription services in chronoform. Here's what I envision: ... would like a confirmation email sent to the user with ... like the ability to send reminder notices to customers. ... customize the subscription form so I can capture specific.
Thanks
Shahzad
Hi Bob,
I am using chronoform for product enquiry. I want following things to do.
- The Customer starts an enquirie
- The system sends the enquirie information via mail to the website team
(including a confirmation link that has to be confirmed by website team within 12h )
and a short thank you mail to the customer
- The system saves the enquirie information with a timestamp to the database
- a website team can check via the xyz.php if there are
unconfirmed mails in the system db
- if there are still enquiries which are not confirmed within 12h the system sends a copy to website team with a new link
I have attached the form screenshot.
Please help me, I am struggling with last 2 weeks.
Thanks
Shahzad
I am using chronoform for product enquiry. I want following things to do.
- The Customer starts an enquirie
- The system sends the enquirie information via mail to the website team
(including a confirmation link that has to be confirmed by website team within 12h )
and a short thank you mail to the customer
- The system saves the enquirie information with a timestamp to the database
- a website team can check via the xyz.php if there are
unconfirmed mails in the system db
- if there are still enquiries which are not confirmed within 12h the system sends a copy to website team with a new link
I have attached the form screenshot.
Please help me, I am struggling with last 2 weeks.
Thanks
Shahzad
Hi Shahzad,
Which parts have you got working? Exactly what help do you need?
Bob
Which parts have you got working? Exactly what help do you need?
Bob
Hi Bob,
Actually, a form is working like that, when user submit a form one mail goes to website team. But now we want that when user submit a form one mail goes to website team with confirmation link, store form data in db and one thank you mail goes to user. After this, when website team click the confirmation link, its confirmed the mail in DB. If they forgot to click that confirmation link, they can check unconfirmed mail in xyz.php and they will also get email reminder after every 12 hours about unconfirmed link. that's the story. I haven't done anything about this functionality.
Thanks
Shahzad
Actually, a form is working like that, when user submit a form one mail goes to website team. But now we want that when user submit a form one mail goes to website team with confirmation link, store form data in db and one thank you mail goes to user. After this, when website team click the confirmation link, its confirmed the mail in DB. If they forgot to click that confirmation link, they can check unconfirmed mail in xyz.php and they will also get email reminder after every 12 hours about unconfirmed link. that's the story. I haven't done anything about this functionality.
Thanks
Shahzad
Hi Bob,
Thanks for quick reply as usual.
How I do these thing which I mention in previous posts. I am new in coding. Please help, I am desperate.
Thanks
Shahzad
Thanks for quick reply as usual.
How I do these thing which I mention in previous posts. I am new in coding. Please help, I am desperate.
Thanks
Shahzad
Hi Shahzad,
You'll need to find someone to help you who has more experience in coding. We can help here whan you have specific problems with your forms and the ChronoForms extnesions but we can't practically write your code for you.
You have quite a big task here, it is all possible but takes some knowledge and experience to get it to work.
Take it one step at a time and by all means ask here when you have a specific problem.
Bob
You'll need to find someone to help you who has more experience in coding. We can help here whan you have specific problems with your forms and the ChronoForms extnesions but we can't practically write your code for you.
You have quite a big task here, it is all possible but takes some knowledge and experience to get it to work.
Take it one step at a time and by all means ask here when you have a specific problem.
Bob
Hi
please can you explain me how you created the module, I'm tring to do the same but I got an error when page loads.
I'm trying to put a link in a product page and clicking on this link user is redircted to a form which have to contain the title of the product from which he come.
I tryed to create a module as explained by you but I got an error when I load the page containing the module:
Fatal error: Call to a member function isSite() on a non-object in C:\xampp\htdocs\studiodelta.it\modules\mod_jumi\tmpl\default.php(18) : eval()'d code on line 2
thanks a lot for your help
Fabrizio
please can you explain me how you created the module, I'm tring to do the same but I got an error when page loads.
I'm trying to put a link in a product page and clicking on this link user is redircted to a form which have to contain the title of the product from which he come.
I tryed to create a module as explained by you but I got an error when I load the page containing the module:
Fatal error: Call to a member function isSite() on a non-object in C:\xampp\htdocs\studiodelta.it\modules\mod_jumi\tmpl\default.php(18) : eval()'d code on line 2
thanks a lot for your help
Fabrizio
This topic is locked and no more replies can be posted.