Edit Form returning blank data - HELP!!

EPark1016 25 Sep, 2009
I'm using ChronoForms for user submission and ChronoConnectivity to view the entries in the admin. The problem is that some records, when I go to edit them in the backend, they come up blank. I know the data is there, because I can see it in the initial admin view and in the code once I go to edit, but I can't see the data in the form itself. HELP!
GreyHead 25 Sep, 2009
Hi EPark1016,

The Admin Edit appears to be broken in the current release - I'm afraid that I just use the Front-end version and set the permissions to Admins only.

Bob
EPark1016 25 Sep, 2009
do all of the same features work?
GreyHead 25 Sep, 2009
Hi EPark1016,

Sorry, I've no idea - all the ones that I need seem to be OK.

Bob
EPark1016 25 Sep, 2009
well, in short, I need the publish capability... I know the others work
GreyHead 25 Sep, 2009
Hi EPark1016,

Apologies for the question but what is the 'publish' capability?

Bob
EPark1016 25 Sep, 2009
on the backend, you can publish articles, posts, etc., so I just need to make sure I can do that with frontend management too
EPark1016 25 Sep, 2009
In this particular case, some entries on the front end, when I go to edit, are blank too...
GreyHead 28 Sep, 2009
Hi Epark1016,

Some entries have values and others don't? Can you give some examples? Are they different kinds of inputs?

Bob
EPark1016 28 Sep, 2009
I have a form which the end user completes... I'm using Chrono Connectivity to manage the data, publish comments, etc. The problem is, when you go to edit a comment, the form is blank. Here's what's bizzare, you can see the code writing the data when I view source. See below:

window.addEvent('domready', function() {
$('ChronoContact_editletter').getInputByName('cf_id').setValue('1055', '');
$('ChronoContact_editletter').getInputByName('uid').setValue('IYzBlNjY5YjVmNzNl', '');
$('ChronoContact_editletter').getInputByName('recordtime').setValue('2009-09-28', '');
$('ChronoContact_editletter').getInputByName('ipaddress').setValue('131.94.39.54', '');
$('ChronoContact_editletter').getInputByName('cf_user_id').setValue('0', '');
$('ChronoContact_editletter').getInputByName('to').setValue([email]'user@user.com[/email]', '');
$('ChronoContact_editletter').getInputByName('email').setValue([email]'user@gmail.com[/email]', '');
$('ChronoContact_editletter').getInputByName('subject').setValue('6 Month Marriage on the Verge of Divorce - HELP! ', '');
$('ChronoContact_editletter').getInputByName('optin').setValue('Yes', '');
$('ChronoContact_editletter').getInputByName('fullname').setValue('Rachel ', '');
$('ChronoContact_editletter').getInputByName('telephone').setValue('305-724-3560', '');
$('ChronoContact_editletter').getInputByName('letter').setValue('<span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">Good Morning Steve and Shirley, </span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">About two months ago my husband of 6 months and I got into a huge argument. Since then he has told me he is no longer happy, no longer in love with me and wanted a divorce, not to mention that he no longer wears his wedding band. At first I was completely stunned and thought he's with another woman. However, after confirming he is not with another woman I proceed to do all the things every self help book tells you not to do, beg, plead, nag and tell him he was dumb to want this marriage to end. Of course NONE of this worked until I had my "ah-ha moment" in which I saw myself through his eyes and I did not like the woman I had become. I realize that I made many mistakes and I am ready to take my share of the blame for some of the failures in our young marriage. </span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">Without going into too much detail, one of the worst mistakes I made was not giving up the cookie as much as I should have for some reasons I now see, after reading your book, were very stupid.<span> </span>He has told a mutual friend of ours that this was one of the main reasons he wanted the divorce.<span> </span></span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">We decided to separate and we even tried couples counseling. Which was a complete mess, because the therapist seemed to make us argue more and never really gave us solutions on how to solve our problems.<span> </span>She even singled me out and said I was the one to blame for our marriage going wrong and said I was co-dependent, to which my husband turned to her and said my wife is very self sufficient.<span> </span>We both agreed we would not go back to counseling and try to work on it on our own.<span> </span>Although he says he wants things to be amicable between us and that’s why he hasn’t filed for divorce.<span> </span>He was avoiding speaking to me for some time because he said "I can't talk to you when you cry, it kills me to see you cry, maybe when you calm down we can talk". He also tells me that he's miserable and that he's not sure what the future holds but that maybe in a couple of months something could happen. I'm not sure how to interpret any of this. Now that I have gained some of swag back, when we speak on the phone I am cheerful and confident and very vague, because I realize that I cannot allow this man to treat me like a doormat.<span> </span>After 2 weeks of no contact we decided to meet up this past Friday and it went very well.<span> </span>I was composed and myself again and he kept saying how much more he liked this side of me.<span> </span>He asked me questions and I answered truthfully and I think some of my answered stunned him a bit, for example, I told him how I thought the separation was a great idea because it gave me time to think and work on myself.<span> </span>I didn’t, however, answer all his questions, like when he asked me if “I thought about us”?<span> </span>Instead I pretended not to hear him because the waiter was at the table.<span> </span>Although I know he’s probably thinking divorce is still the best option I really want to know is there any way to get through to this man that I adore so much?</span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">I am asking that you please guide me in the right direction to actually saving my marriage.<span> </span>I love this man and am still very much in love with him and I know this man loves me and I want to fight as long as I can.<span> </span>Is there hope Mr.Harvey? </span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">Sincerely, </span><span style="font-size: 9pt; color: #333333; font-family: 'Tahoma','sans-serif'">The Stunned Honeymooner </span>', '');
$('ChronoContact_editletter').getInputByName('published').setValue('0', '');
$('ChronoContact_editletter').getInputByName('publish_date').setValue('0000-00-00', '');

});
GreyHead 28 Sep, 2009
Hi EPark1016,

Well that looks like the JavScript that should be setting the values in the form so it looks as though there is some kind of a JavScript error that is breaking the script. Hard to say more without seeing the page.

Bob
EPark1016 01 Oct, 2009
so I've isolated the problem... its the apostrophe (') in the fields causing it to break. In those entries without apostrophes, it posts. Is there a way to remove the apostrophes from submissions?
GreyHead 01 Oct, 2009
Hi Epark1016,

You'll need to make sure that the entry is properly 'escaped' before it is saved. Try this code in the OnSubmit Before Box
<?php
$letter =& JRequest::getVar('letter');
$db =& JFactory::getDBO();
$letter = $db->quote($letter);
JRequest::setVar('letter;, $letter);
?>

I'm not sure if this will work or not; if not, there are some other PHP escaping functions that you can try.

Bob
EPark1016 01 Oct, 2009
Thanks Bob! Question, would it make a difference if Tiny MCE is my editor? My form code for that field is:

<?php
$editor		=& JFactory::getEditor();
echo $editor->display( 'letter',  '' , '80%', '350', '55', '20', false ) ;
?> 
GreyHead 01 Oct, 2009
Hi EPark1016,

Sorry, I have no idea at all.

Bob
EPark1016 01 Oct, 2009
I saw this post

http://www.chronoengine.com/forums.html?cont=posts&f=4&t=4722

So I'm wondering if that will help, but instead of adding slashes, I'd rather just strip the apostrophe altogether. My generated form code is:

<?php
		$MyForm =& CFChronoForm::getInstance();
		if($MyForm->formparams("dbconnection") == "Yes"){
			$user = JFactory::getUser();			
			$row =& JTable::getInstance("chronoforms_strawberry", "Table");
			srand((double)microtime()*10000);
			$inum	=	"I" . substr(base64_encode(md5(rand())), 0, 16);
			JRequest::setVar( "recordtime", JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" ));
			JRequest::setVar( "ipaddress", JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" ));
			JRequest::setVar( "uid", JRequest::getVar( "uid", $inum, "post", "string", "" ));
			JRequest::setVar( "cf_user_id", JRequest::getVar( "cf_user_id", $user->id, "post", "int", "" ));
			$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );			
			if (!$row->bind( $post )) {
				JError::raiseWarning(100, $row->getError());
			}				
			if (!$row->store()) {
				JError::raiseWarning(100, $row->getError());
			}
			$MyForm->tablerow["jos_chronoforms_strawberry"] = $row;
		}
		?>
		


I do appreciate you taking time out to review these. I've been at this for weeks!
This topic is locked and no more replies can be posted.