Hello there,
I've already tried to use sample form located in download section, but my problem is different. I'll try to give simple explanation.
I have form with following fields:
textFieldA
textFieldB
textAreaC
dropDownD
I created form like this and I'm able to save data to table in my joomla database, for example MyTable.
Is it possible now to use data from MyTable and write them in jos_content table, where jos_content fields would be created as:
title = textFieldA + textFieldB
introtext = textAreaC + dropDownD
Section id and category id would be predefined.
Can anyone give me a hint is this possible or not.
Thanks in advance
I've already tried to use sample form located in download section, but my problem is different. I'll try to give simple explanation.
I have form with following fields:
textFieldA
textFieldB
textAreaC
dropDownD
I created form like this and I'm able to save data to table in my joomla database, for example MyTable.
Is it possible now to use data from MyTable and write them in jos_content table, where jos_content fields would be created as:
title = textFieldA + textFieldB
introtext = textAreaC + dropDownD
Section id and category id would be predefined.
Can anyone give me a hint is this possible or not.
Thanks in advance
Hi djordrew,
Yes that's possible.
You need to use the OnSubmit Before box* to pre-process the values. Here's a basic example:
Bob
* You must have Send Emails set to 'Yes' in the form General tab for this box to function.
Yes that's possible.
You need to use the OnSubmit Before box* to pre-process the values. Here's a basic example:
<?php
$textfieldA = JRequest::getString('textfieldA', '', 'post');
$textfieldB = JRequest::getString('textfieldB', '', 'post');
$title = $textfieldA.$textfieldB;
JRequest::setVar('title', $title);
?>
Bob
* You must have Send Emails set to 'Yes' in the form General tab for this box to function.
I get really strange error, please note it is JRqeuest and not JRequest
Any idea?
Fatal error: Class 'JRqeuest' not found
Any idea?
ops sorry, I copied your typo 😶
Thanks GreyHead, I'll see what happens now😉
Thanks GreyHead, I'll see what happens now😉
Hi Bob,
I tried something like this, it looks like I'm doing something wrong.
Here is the code I used trying only to set article title, section and category:
Email sent contains all the data, but article created doesn't have article title, while sectionid and catid are set correctly.
Any idea where I'm doing wring?
Thanks in advance
I tried something like this, it looks like I'm doing something wrong.
Here is the code I used trying only to set article title, section and category:
<?php
$select1 = JRequest::getString('$select1', '', 'post');
$select2 = JRequest::getString('$select2', '', 'post');
$title = $select1.$select2;
JRequest::setVar('title', $title);
JRequest::setVar('sectionid', 5);
JRequest::setVar('catid', 23 );
JRequest::setVar('state', 0);
?>
Email sent contains all the data, but article created doesn't have article title, while sectionid and catid are set correctly.
Any idea where I'm doing wring?
Thanks in advance
Hi djordrew,
Mea culpa . . . there was another typo in there too - I left some $s in the wrong place. Should be
Bob
PS I corrected my earlier post.
Mea culpa . . . there was another typo in there too - I left some $s in the wrong place. Should be
$select1 = JRequest::getString('select1', '', 'post');
$select2 = JRequest::getString('select2', '', 'post');
Bob
PS I corrected my earlier post.
This topic is locked and no more replies can be posted.