Editing submitcontent.cfbak

hlau781 12 Mar, 2009
I am really liking this ChronoForm for Submitcontent.cfbak

However, I have two questions on how to edit so that it becomes fully functional.

The first question is how to modify the form so that I have the ability to have a dropdown list of categories presented on the form (From a single section) for the user to pick from.

My second question is how to modify the form so that it uses a textarea box instead of the joomla's fulltext editor.

Thanks so much!
Max_admin 12 Mar, 2009
Hi hlau781,

this is a dropdown code to insert in the HTML code box under the Form code tab:

<select name"catid">
<option value="9">category 1</option>
<option value="8">category 2</option>
</select>

this code is only as example, you should load the real categories and values!

the code for text area :

<textarea name="fulltext"></textarea>


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hlau781 12 Mar, 2009
Hi Max,

Thanks for the help so far. I'm having issues setting the category though. This is my current code. It isn't defining my categories at all.

<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label">Select Category</label>
<select name="catid">
<option value="">Choose Option</option>
<option value="1">Love</option>
<option value="2">Hate</option>
</select>

What coding am I missing?

Thanks,
hlau781
Max_admin 13 Mar, 2009
Hi,

I'm having issues setting the category though



what issues ? you have 1 or 2 unclosed divs, that's all!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 14 Mar, 2009
Hi hlau781,

In Joomla 1.5 you can create a category dropdown with one line of code
<?php
echo JHTML::_('list.category', 'field_name', 'section_id');
?>
or for a section list
<?php
echo JHTML::_('list.section', 'field_name');
?>

Bob
Max_admin 14 Mar, 2009

Hi hlau781,

In Joomla 1.5 you can create a category dropdown with one line of code

<?php
echo JHTML::_('list.category', 'field_name', 'section_id');
?>
or for a section list
<?php
echo JHTML::_('list.section', 'field_name');
?>

Bob



Hi Bob,

That's great, I missed this!🙂

Thanks!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hlau781 31 Mar, 2009
Hey Max and Bob.

So this is what I'm using now,

It gives me no errors but it won't add the article onto my article manager. I don't know whats wrong...

Thanks for the help!

hlau781





<div class="form_item">
<div class="form_element cf_heading">
<h1 id="" class="cf_text">Submit your Blah story!</h1>

</div><div class="clear"> </div></div>

<div class="form_item">
<div class="form_element cf_text">
<span class="cf_text">Write about anything that you would like to vent about. Just remember that all entries end with a "Blah!". Please don't use slang and try to avoid spelling mistakes.Read your message over to correct!</span></div>
<div class="clear"> </div></div>

<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label">Your Alias:</label>
<input class="cf_inputbox required validate-alpha" maxlength="15" size="30" id="text_7" name="title" type="text">
<a onclick="return false;" class="tooltiplink"><img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" width="16" border="0" height="16"></a>
<div class="tooltipdiv">Your name: :: Your nickname as you like it to appear with the story!</div></div>

<div class="form_item">
<div class="form_element cf_textarea" style="width:600px;">
<label class="cf_label">Story body:</label>
<textarea class="cf_inputbox required" rows="8" id="text_4" cols="35" name="fulltext" type="text"></textarea>

</div><div class="clear"> </div></div>

<div class="form_item"><div class="form_element cf_textbox">
<label class="cf_label">Your Email:</label>
<input class="cf_inputbox" maxlength="150" size="30" id="text_5" name="created_by_alias" type="text">
<a onclick="return false;" class="tooltiplink">
<img src="components/com_chronocontact/css/images/tooltip.png" class="tooltipimg" width="16" border="0" height="16"></a>
<div class="tooltipdiv">Your Email: :: Your Email Address is optional.</div></div>

</div><div class="clear"> </div>

<div class="form_item">
<div class="form_element cf_dropdown">
<?php
echo JHTML::_('list.category', 'field_name', '1');
?>
</div>

</div><div class="clear"> </div></div>

<div class="form_item">
<div class="form_element cf_captcha">
<label class="cf_label">Enter code as shown</label>
<span>{imageverification}</span>

</div><div class="clear"> </div></div>

<div class="form_item"><div class="form_element cf_button">
<input value="Submit Story" name="undefined" type="submit">

</div><div class="clear"> </div></div>
Max_admin 31 Mar, 2009
Hi,
echo JHTML::_('list.category', 'field_name', '1');


should be

echo JHTML::_('list.category', 'catid', '1');


I think!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hlau781 31 Mar, 2009
Its still not working.

The problem is the page loads to the

"Thank you for submitting your story, we will review it shortly and if approved it will be published!

Cheers

ChronoEngine.com team!"

but the form is not displaying the article in my article manager.

I also tried to now start with a complete new submitcontent.cfbak and tested it to try to see if the data would get transferred without editing the form, but now it doesn't work also.

I have other plugins and components installed on my Joomla. Could that be the issue? Conflicting components or something?

Thanks!

hlau781
Max_admin 01 Apr, 2009
Hi hlau781,

when you load a new submitcontent form you must do the changes listed in the Downloads area, you need to set the catid and sectionid values in the onsubmit code area to valid values per your site!

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
hlau781 01 Apr, 2009
I followed "2 important things to do before getting it to work" and still can not get it done with the original submitcontent.cfbak.

I set the catid and sectionid to 1 and 1 which do exist.

I don't know what to do!

Thanks,
hlau781
GreyHead 01 Apr, 2009
Hi hlau781,

Please email or PM me a SuperAdmin login to your site and I'll take a look.

Bob
GreyHead 02 Apr, 2009
Hi hlau781,

Found the problem. You have two sets of Joomla tables in the database, One has a prefix 'mdb_', the other the prefix 'jos_'. Your site is set to use 'mdb_' but the ChronoForms database connection was to 'jos_content'. The form data was saving perfectly but to the wrong place.

I've switched the ChronoForms connection to 'mdb_content' and it works OK now.

Bob
GreyHead 02 Apr, 2009
Hi hlau781,

Sorry, I left debug turned on - set it to No near the bottom of the General Tab.

Bob
TWD 11 Apr, 2009
I am having the same problem with content not showing up. I have checked and I don't have a mdb_content or any other content location other than jos_content.

I am using Cat 3 and Sec 1 which both exist.

I get the thank you screen and also the email but no articles are in my manager. I'm using Joomla 1.5.

Any suggestions?
GreyHead 11 Apr, 2009
Hi TWD,

I've not the slightest idea.
If you like email or PM me a SuperAdmin login to your site and I'll take a look.

Bob
TWD 11 Apr, 2009
I figured it out this morning. Was a mod_security issue. Is there a work around for this other than SecFilterEngine Off SecFilterScanPOST Off
Max_admin 13 Apr, 2009
I don't know about this issue, I will see if the code can be improved alittle for this form!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
musgod 19 May, 2010
I am trying to use the sumitcontent but cant get the articles to post to the right categories.

MY CODES - Form HTML:
I humbly request that if you may desire, or know of anyone who may, to make a submission on one or more Platform Planks. From now until December 31st 2010, I am seeking submissions for the establishment of a Hip-Hop Political Party Platform. 

<P>

You can also email submissions to definehiphop@gmail.com 

<P>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Name</label>
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_0" name="created_by_alias" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>



<div><div  class="form_item">

  <div class="form_element cf_dropdown">
    <label class="cf_label" style="width: 150px;">Topic</label>
    <?php
echo JHTML::_('list.category', 'catid', '1');
?>  </div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Email</label>
    <input class="cf_inputbox validate-email" maxlength="150" size="30" title="" id="text_1" name="email" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>


<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Phone</label>
    <input class="cf_inputbox validate-number" maxlength="150" size="30" title="" id="text_1" name="phone" type="text" />
  </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Name</label>
    <input class="cf_inputbox required validate-alphanum" maxlength="150" size="30" title="" id="text_0" name="title" type="text" />
  
  </div>
</div?
 
  <div class="cfclear"> </div>

<div  class="form_item"><div class="form_element cf_textarea" style="width:450px;" onkeyup="textLimit(this, 1000);"><label class="cf_label">Story body:</label>
<?php
$editor		=& JFactory::getEditor();
echo $editor->display( 'fulltext',  '' , '80%', '350', '55', '20', false ) ;
?>
</div><div class="clear"> </div></div>

<div  class="form_item"><div class="form_element cf_captcha"><label class="cf_label">Enter code as shown</label><span>{imageverification}</span></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_button"><input value="Submit Story" name="undefined" type="submit"></div><div class="clear"> </div></div>

MY CODE - On Submit code - after sending email:
<p><span style="color: #0000ff;"><strong>Thank you for your submission, we will review it shortly and if approved it will be published to the website for review by the general public!</strong></span></p>
<p><strong>Cheers</strong></p>
<p><span style="text-decoration: underline;"><strong>Committee to Form a Hip-Hop Political Party</strong></span></p>
<?php
$_POST['catid'] = '';
$_POST['id'] = '';
$_POST['sectionid'] = '1';
$_POST['state'] = '0';
$_POST['created'] = date("Y-m-d H:i:s");
?>
GreyHead 19 May, 2010
Hi musgod,

You need to set the Category Ids in the OnSubmit code
$_POST['catid'] = '?????';
$_POST['id'] = '';
$_POST['sectionid'] = '1';
The current version of the form has this code in the box
<div style='border:1px solid silver; padding:6px; margin:6px;' >
<div style='color: blue; ' >Thank you for submitting your story, we will review it shortly and if approved it will be published!</div>
<div>Cheers<br />
the ChronoEngine.com team! </div>
<div style='font-style: italic; border:1px solid silver; padding:3px;' >Note: Edit the OnSubmit After code box to change this message</div>
</div>
<?php
//JRequest::setVar('catid', '1', 'post');
JRequest::setVar('sectionid', '1', 'post');
JRequest::setVar('id', '', 'post');
JRequest::setVar('state', '0', 'post');
JRequest::setVar('created', date("Y-m-d H:i:s"), 'post');
?> 

Bob
This topic is locked and no more replies can be posted.