Forums

Article Submission form

hyrum_0 22 Nov, 2014
I've searched the forums for a way to submit a joomla article with custom fields. All the CCK's out there are too much for what I want. Chronoforms should be able to do it simple enough for me to understand. Are there any sample forms for this???
Max_admin 22 Nov, 2014
Hello hyrum_0,

There is a "submit article" action in Chronoforms, you can use it to create articles of your form data, you may also add extra fields to the Joomla articles table, or save any extra info to another table using a "DB Save" action.

But then how do you want to use the extra data ?

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
hyrum_0 22 Nov, 2014
I want to make a project proposal form for my users and store the submissions as articles. So I would have simple text fields like: synopsis, objectives, deadline, summary, scope... and then paste those in the article body with the field names as headings. It seems pretty simple. If there are no sample forms, I'll start from scratch, but it would be nice to have something to start with.

Thanks for any help!
GreyHead 22 Nov, 2014
Hi hyrum_0,

Assuming that you use the same names for your form inputs you would build the article in a Custom code action something like this:
<?php
$form->data['full_text'] = "
<h3>Synopsis</h3>
<div>{$form->data['synopsis']}</div>
<h3>Objectives</h3>
<div>{$form->data['objectives']}</div>
<h3>Deadline</h3>
<div>{$form->data['deadline']}</div>
<h3>Summary</h3>
<div>{$form->data['summary']}</div>
<h3>Scope</h3>
<div>{$form->data['scope']}</div>
";
?>

Then put full_text in the Full text field box of the Joomla! Article action.

Bob
hyrum_0 22 Nov, 2014
Thanks!!! I am adding some more fields and also making a intro_text field too.

some other questions:
1. after I customize the code you wrote, I go to the code tab and choose custom code, then paste it into the text area?
2. Will the registered user, filling out the form, be the article creator in Joomla? If not, how to do?
3. If I follow the 'buy me a coffee' link, it's like making a donation to chronoforms?
GreyHead 22 Nov, 2014
Hi hyrum_0,

Test with a simple form first, then add more inputs. features!

1. Yes
2. Yes, I think so, please test to be sure.
3. No, that link goes to me, not to ChronoForms.

Bob



Bob
hyrum_0 22 Nov, 2014
When the article is submitted, the registered user is made the article author so that's good. Everything seemed to work fine, but not my custom content. It was not included in the article contents.

It's probably due to how I added the custom php code. You can see it below. I added the modified code you gave me, to the end of the code. I really don't know how to add it.


<div class="chronoform-container" id="chronoform-container-1">
					<ul class="nav nav-tabs"><li class="active"><a href="#chronoform-container-2" data-g-toggle="tab">Required</a></li><li><a href="#chronoform-container-3" data-g-toggle="tab">Extra</a></li></ul>
					<div class="tab-content"><div id="chronoform-container-2" class="tab-pane active"><div class="form-group gcore-form-row" id="form-row-article title"><label for="article title" class="control-label gcore-label-left">Project Title</label>
<div class="gcore-input gcore-display-table" id="fin-article title"><input name="article-title" id="article title" value="" placeholder="" maxlength="" size="" class="validate['required'] form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /></div></div><div class="form-group gcore-form-row" id="form-row-synopsis"><label for="synopsis" class="control-label gcore-label-left">Synopsis</label>
<div class="gcore-input gcore-display-table" id="fin-synopsis"><textarea name="synopsis" id="synopsis" placeholder="" rows="2" cols="40" class="validate['required'] form-control A" title="" style="" data-wysiwyg="0" data-load-state="" data-tooltip=""></textarea><span class="help-block">Simple and short synopsis</span></div></div><div class="form-group gcore-form-row" id="form-row-purpose"><label for="purpose" class="control-label gcore-label-left">Purpose of Project</label>
<div class="gcore-input gcore-display-table" id="fin-purpose"><textarea name="purpose" id="purpose" placeholder="" rows="3" cols="40" class="form-control A" title="" style="" data-wysiwyg="0" data-load-state="" data-tooltip=""></textarea><span class="help-block">How the project supports the AP mission</span></div></div><div class="form-group gcore-form-row" id="form-row-objectives"><label for="objectives" class="control-label gcore-label-left">Product Description</label>
<div class="gcore-input gcore-display-table" id="fin-objectives"><input name="objectives" id="objectives" value="" placeholder="" maxlength="75" size="" class="validate['required'] form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /><span class="help-block">Simple Product Description</span></div></div></div><div id="chronoform-container-3" class="tab-pane"><div class="form-group gcore-form-row" id="form-row-additional"><label for="additional" class="control-label gcore-label-left">Extra Details</label>
<div class="gcore-input gcore-display-table" id="fin-additional"><textarea name="additional" id="additional" placeholder="" rows="3" cols="40" class="form-control A" title="" style="" data-wysiwyg="0" data-load-state="" data-tooltip=""></textarea><span class="help-block">Any other details</span></div></div><div class="form-group gcore-form-row" id="form-row-deadline"><label for="deadline" class="control-label gcore-label-left">ETA</label>
<div class="gcore-input gcore-display-table" id="fin-deadline"><input name="deadline" id="deadline" value="" placeholder="" maxlength="" size="" class="form-control A" title="" style="" data-inputmask="" data-load-state="" data-tooltip="" type="text" /><span class="help-block">When might this project be complete?</span></div></div></div></div></div><div class="form-group gcore-form-row" id="form-row-button5"><div class="gcore-input gcore-display-table" id="fin-button5"><input name="button5" id="button5" type="submit" value="Submit" class="form-control A" style="" data-load-state="" /></div></div>
<?php
$form->data['full_text'] = "
<h3>Synopsis</h3>
<div>{$form->data['synopsis']}</div>
<h3>Purpose</h3>
<div>{$form->data['purpose']}</div>
<h3>Objectives</h3>
<div>{$form->data['objectives']}</div>
<h3>Additional Details</h3>
<div>{$form->data['additional']}</div>
<h3>Deadline</h3>
<div>{$form->data['deadline']}</div>
";
$form->data['intro_text'] = "
<h3>Synopsis</h3>
<div>{$form->data['synopsis']}</div>
<h3>Purpose</h3>
<div>{$form->data['purpose']}</div>
";
?>

Max_admin 23 Nov, 2014
Answer
The code posted by Bob should be added inside a "Custom code" action above the "submit article" action, but not in the form code section!

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
hyrum_0 23 Nov, 2014
Thanks for the clarification. It works 99% perfectly now. This topic can be closed!!!

I can probably discover on my own how to submit with a different access level (now it submits as guest and I prefer public), but I can live with either one.

Awesome😀
Max_admin 24 Nov, 2014
Also in the same code box:
$form->data["access"] = 1;//any access level id here


Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.