In old version of Chronoform I use this code for auto load "Article Title" to a Texs Box in form on "Field Default Value".
<?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; ?>
Can you make new code for Chronoform v4 or latest version ? and for Jommla 3.x
Thank you very much.
<?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; ?>
Can you make new code for Chronoform v4 or latest version ? and for Jommla 3.x
Thank you very much.
Hi belakangmeja
Patrick
<?php
$option = JRequest::getVar('option');
$view = JRequest::getVar('view');
if ( $option == 'com_content' && $view == 'article' ) {
$id = JRequest::getInt('id');
$article =& JTable::getInstance('content');
$article->load($id);
$article_title = $article->get('title');
}
echo $article_title;
?>Patrick
Hi,
In ChronoForms v4 I would put this into a Custom Code action and replace the echo line with
Bob
In ChronoForms v4 I would put this into a Custom Code action and replace the echo line with
$form->data['article_title'] = $title;where 'article_title' is the name of the title input.<?php
$form->data['article_title'] = '';
if ( isset($form->data['option']) && $form->data['option'] == 'com_content' && isset($form->data['id']) ) {
$article =& JTable::getInstance('content');
$article->load($form->data['id']);
$form->data['article_title'] = $article->get('title');
}
?>Bob
Hi,
In ChronoForms v4 I would put this into a Custom Code action and replace the echo line with
$form->data['article_title'] = $title;where 'article_title' is the name of the title input.<?php
$form->data['article_title'] = '';
if ( isset($form->data['option']) && $form->data['option'] == 'com_content' && isset($form->data['id']) ) {
$article =& JTable::getInstance('content');
$article->load($form->data['id']);
$form->data['article_title'] = $article->get('title');
}
?>Bob
Hi
i dont know much about coading.
can you instaction how to do it
Hi [email]info@machinaprinting.com[/email],
I'm not clear what else you need; the instructions are right there.
Bob
PS I suggest that you do not use an email address as a username here - it will be publicly visible and may be scraped by spammers.
I'm not clear what else you need; the instructions are right there.
Bob
PS I suggest that you do not use an email address as a username here - it will be publicly visible and may be scraped by spammers.
Hi [email]info@machinaprinting.com[/email],
Thanks for the form link. I can see the article title is being set correctly in the hidden input.
So the question is what are you using to display it when the form is submitted? It should be {title}
Bob
Thanks for the form link. I can see the article title is being set correctly in the hidden input.
<input id="title" type="hidden" value="Heidelberg Offset" name="title">So the question is what are you using to display it when the form is submitted? It should be {title}
Bob
This topic is locked and no more replies can be posted.
