Buy Now
Sign in

Submit content to an article problem

BBplayer , April 02 2010
B
BBplayer 9
April 02 2010 #49536
Hi,

I've created my form with following fields:

$text_4
$text_2
$date_3
$select_9
$select_5

I'm able to save data to a jos_content table and section and category id are predefined.

When I try the form, the data are stored in my section, i can read the title but when I open the article there isn't the content.

At Onsubmit code i put this:

<?php
$text_4 = JRequest::getString('text_4', '', 'post');
$text_2 = JRequest::getString('text_2', '', 'post');
$date_3 = JRequest::getString('date_3', '', 'post');
$select_9 = JRequest::getString('select_9', '', 'post');
$select_5 = JRequest::getString('select_5', '', 'post');
$title = $text_4.$text_2.$date_3;
JRequest::setVar('title', $title);
JRequest::setVar('sectionid', 2);
JRequest::setVar('catid', 4);
JRequest::setVar('state', 1);
?>


Can anyone help me?

Thanks a lot
GreyHead 63.4
April 02 2010 #49541
Hi BBPlayer,

The jos_content table has predefined columns for the article content and you need to save to these columns.

The submitcontent form from the donwnload area here is designed to let you do that.

Bob

**Warning** don't add extra columns to core Joomla tables unless you know exactly what you are doing, and even then best not to.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
B
BBplayer 9
April 02 2010 #49542
So if I want to add a select field and read the selected option in a content, I can't?

Thanks
GreyHead 63.4
April 02 2010 #49545
Hi BBPlayer,

Yes you can but you have to put it into one of the standard content 'fields' first. You can do this in the OnSubmit Before code box.

There are one or two other threads discussing this with some examples if you search on submit_content

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
B
BBplayer 9
April 02 2010 #49547
I found it.

Thanks Bob :wink: