Forums

Getting errors in chrono admin..tables not working

ksmith 28 Sep, 2010
I setup the form and then I went to create the table. I am getting these types of codes in the top white area of the chronoform pages...

box', '30', 'dfromname_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'Dynamic From Name', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else if(thisitemtype == 'cf_fromemail'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'fromemail_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'From Email', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else if(thisitemtype == 'cf_dfromemail'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'dfromemail_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'Dynamic From Email', 'input_'+counter); newLabel.createElement().injectTop(theitem); //v3.1 }else if(thisitemtype == 'cf_replytoname'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'replytoname_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'ReplyTo Name', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else if(thisitemtype == 'cf_dreplytoname'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'dreplytoname_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'Dynamic ReplyTo Name', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else if(thisitemtype == 'cf_replytoemail'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'replytoemail_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'ReplyTo Email', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else if(thisitemtype == 'cf_dreplytoemail'){ theitem.empty(); var newTextbox = new CFTEXTBOX('cf_inputbox', '30', 'dreplytoemail_'+counter); newTextbox.createElement().injectTop(theitem); theitem.addClass('cf_textbox'); var newLabel = new CFLABEL('cf_label', 'Dynamic ReplyTo Email', 'input_'+counter); newLabel.createElement().injectTop(theitem); }else {} form_item = new Element('div').setProperty("class", 'form_item_email'); theitem.injectInside(form_item); theitem = form_item; // add main attributes theitem.getLast().injectHTML('', 'after'); theitem.getLast().setStyle('display', 'none'); theitem.getLast().addEvent('click', function(e) { new Event(e).stop(); this.getParent().remove(); if(($chk($E('input[name^=to_]', droparea)) || $chk($E('input[name^=dto_]', droparea))) && ($chk($E('input[name^=subject_]', droparea)) || $chk($E('input[name^=dsubject_]', droparea))) && ($chk($E('input[name^=fromname_]', droparea)) || $chk($E('input[name^=dfromname_]', droparea))) && ($chk($E('input[name^=fromemail_]', droparea)) || $chk($E('input[name^=dfromemail_]', droparea))) ){ droparea.effect('background-color', {wait: false, duration: 100}).start('CEFF63','CEFF63'); }else{ var email_params = $('params_'+droparea.getProperty('name')).value.split(','); $('params_'+droparea.getProperty('name')).value = email_params[0] + ',' + email_params[1] + ',' + '0,1,1'; $('prop_cf_Email_enable').value = 0; $('prop_cf_Email_enable').disabled = true; droparea.effect('background-color', {wait: false, duration: 100}).start('FFAEA5','FFAEA5'); } }) theitem.getLast().injectHTML('

', 'after'); theitem.addEvents({ 'mouseover': function(e) { //new Event(e).stop(); theitem.effect('background-color', {wait: false, duration: 100}).start('E7DFE7','E7DFE7'); }, 'mouseout': function(e) { //new Event(e).stop(); theitem.effect('background-color', {wait: false, duration: 100}).start('ffffff','ffffff'); }, 'click': function(e) { //new Event(e).stop(); $ES('.form_item_email',droparea).each(function(item2){ item2.setStyle('border', '0px solid #000'); $E('.delete_icon', item2).setStyle('display', 'none'); }); theitem.effect('background-color', {wait: false, duration: 100}).start('ffffff','ffffff'); theitem.setStyle('border', '1px solid #000'); $E('.delete_icon', theitem).setStyle('display', 'inline'); } }); theitem.effect('background-color', {wait: false, duration: 100}).start('E7DFE7','E7DFE7'); var dropthis = 1; if((thisitemtype == 'cf_fromemail')||(thisitemtype == 'cf_dfromemail')){ if($chk($E('input[name^=fromemail_]', droparea)) || $chk($E('input[name^=dfromemail_]', droparea))){ $('logdiv').setText('Only one From Email or Dynamic From Email is accepted per Email'); dropthis = 0; } } if((thisitemtype == 'cf_fromname')||(thisitemtype == 'cf_dfromname')){ if($chk($E('input[name^=fromname_]', droparea)) || $chk($E('input[name^=dfromname_]', droparea))){ $('logdiv').setText('Only one From Name or Dynamic From Name is accepted per Email'); dropthis = 0; } } if((thisitemtype == 'cf_replytoemail')||(thisitemtype == 'cf_dreplytoemail')){ if($chk($E('input[name^=replytoemail_]', droparea)) || $chk($E('input[name^=dreplytoemail_]', droparea))){ $('logdiv').setText('Only one ReplyTo Email or Dynamic ReplyTo Email is accepted per Email'); dropthis = 0; } } if((thisitemtype == 'cf_replytoname')||(thisitemtype == 'cf_dreplytoname')){ if($chk($E('input[name^=replytoname_]', droparea)) || $chk($E('input[name^=dreplytoname_]', droparea))){ $('logdiv').setText('Only one ReplyTo Name or Dynamic ReplyTo Name is accepted per Email'); dropthis = 0; } } if((thisitemtype == 'cf_subject')||(thisitemtype == 'cf_dsubject')){ if($chk($E('input[name^=subject_]', droparea)) || $chk($E('input[name^=dsubject_]', droparea))){ $('logdiv').setText('Only one Subject or Dynamic Subject is accepted per Email'); dropthis = 0; } } if(dropthis == 1) theitem.injectBefore(droparea.getLast()); counter = counter + 1; if($chk($E('div[class=infodiv]', droparea)))$E('div[class=infodiv]', droparea).remove(); if(($chk($E('input[name^=to_]', droparea)) || $chk($E('input[name^=dto_]', droparea))) && ($chk($E('input[name^=subject_]', droparea)) || $chk($E('input[name^=dsubject_]', droparea))) && ($chk($E('input[name^=fromname_]', droparea)) || $chk($E('input[name^=dfromname_]', droparea))) && ($chk($E('input[name^=fromemail_]', droparea)) || $chk($E('input[name^=dfromemail_]', droparea))) ){ droparea.effect('background-color', {wait: false, duration: 100}).start('CEFF63','CEFF63'); if(droparea.getProperty('id') == 'cf_email_active'){ $('prop_cf_Email_enable').disabled = false; } } //$('emailbuilder').setStyle('height', ($('left_column2').getCoordinates().height + $('top_column2').getCoordinates().height) ); }, 'over': function() { //dropFx.start('98B5C1'); }, 'leave': function() { //dropFx.start('ffffff'); } }); }); //counter = counter + 1; var drag2 = clone.makeDraggable({ droppables: $ES('div[class=cf_email]', $('left_column2')) }); // this returns the dragged element drag2.start(e); // start the event manual }); }); var Tips1 = new ChronoTips($('cf_to')); var Tips2 = new ChronoTips($('cf_dto')); var Tips3 = new ChronoTips($('cf_subject')); var Tips4 = new ChronoTips($('cf_dsubject')); var Tips5 = new ChronoTips($('cf_cc')); var Tips6 = new ChronoTips($('cf_dcc')); var Tips7 = new ChronoTips($('cf_bcc')); var Tips8 = new ChronoTips($('cf_dbcc')); var Tips9 = new ChronoTips($('cf_fromname')); var Tips10 = new ChronoTips($('cf_dfromname')); var Tips11 = new ChronoTips($('cf_fromemail')); var Tips12 = new ChronoTips($('cf_dfromemail')); var Tips90 = new ChronoTips($('cf_replytoname')); var Tips100 = new ChronoTips($('cf_dreplytoname')); var Tips110 = new ChronoTips($('cf_replytoemail')); var Tips120 = new ChronoTips($('cf_dreplytoemail')); var Tipsnew = new ChronoTips($('cf_newemail')); var Tipsdel = new ChronoTips($('cf_delemail')); }); window.addEvent('domready', function() { var top ;//= $('right_column').getPosition().y - 2; var marginChange = new Fx.Style('right_column', 'margin-top', {wait:false, duration:500, transition:Fx.Transitions.Elastic.easeOut}); window.addEvent('scroll', function() { if(!top)top = $('right_column').getPosition().y; marginChange.start(Math.max(0, window.getScrollTop() - top)); }); });

Sometimes the code is shorter or when trying to create a table it will show this when i hit save:

Error while creating table :Incorrect column name 'alt_account_number ' SQL=CREATE TABLE `jos_chronoforms_Account_Submission` (`cf_id` INT(11) NOT NULL auto_increment, `uid` VARCHAR(255) NOT NULL, `recordtime` VARCHAR(255) NOT NULL, `ipaddress` VARCHAR(255) NOT NULL, `cf_user_id` VARCHAR(255) NOT NULL, `Your_company` VARCHAR(255) NOT NULL, `company_phone` VARCHAR(255) NOT NULL, `company_fax` VARCHAR(255) NOT NULL, `company_website` VARCHAR(255) NOT NULL, `Company_contact` VARCHAR(255) NOT NULL, `contacts_phone` VARCHAR(255) NOT NULL, `contact_email` VARCHAR(255) NOT NULL, `account_number` VARCHAR(255) NOT NULL, `first` VARCHAR(255) NOT NULL, `middle` VARCHAR(255) NOT NULL, `Last` VARCHAR(255) NOT NULL, `account_phone` VARCHAR(255) NOT NULL, `alt_account_number ` VARCHAR(255) NOT NULL, `acct_opened` VARCHAR(255) NOT NULL, `acct_closed` VARCHAR(255) NOT NULL, `attempt_date` VARCHAR(255) NOT NULL, `ssnumber` VARCHAR(255) NOT NULL, `acct balance` VARCHAR(255) NOT NULL, `select file` VARCHAR(255) NOT NULL, `company_address` VARCHAR(255) NOT NULL, `account-address` VARCHAR(255) NOT NULL, `debt_steps` VARCHAR(255) NOT NULL, `acct_contacts` VARCHAR(255) NOT NULL, PRIMARY KEY (`cf_id`)) ENGINE = MYISAM ;

I am not sure what the issue is..used this on another site fine not sure whats wrong? Any help?
GreyHead 29 Sep, 2010
Hi ksmith,

There are two different problems here.

The first is a known problem with ChronoForms. It seems to be reported once every couple of months or so but, as far as I know Max has not yet found a specific cause or fix. What's happening is that some of the ChronoForms JavaScript is being displayed in the browser instead of being executed. It seems erratic - as you say the amount of code displayed varies; and is pretty rare.

The second is a problem with input names. You have a space in

Rename the input and the corresponding column name a column name and presumably in the corresponding input name:
Incorrect column name 'alt_account_number ' 
Rename both then refresh the DB Connection (see below) and that errro should be fixed.

Bob

You need to refresh the DB Connection after any changes to database column names. In the Form Editor click the DB Connection tab and set the Connection to 'No'. Click the 'Apply icon in the toolbar to save the form, open the DB Connection tab, set the Connection back to 'Yes' and re-save the form. This will refresh the copy of the table information that ChronoForms uses.
This topic is locked and no more replies can be posted.