hi all,
when adding a new field to a form that already has a table assigned the table wouldn't update, i.e. the new field wouldn't be added.
while I've seen a hint in here that it would need to be added to $form->data['modelID'] I do not see the also mentioned DB Connection tab anywhere.
could somebody pls help me out?
J!1.5.23; CF4 RC1.8
J!1.5.23; CF4 RC1.8
when adding a new field to a form that already has a table assigned the table wouldn't update, i.e. the new field wouldn't be added.
while I've seen a hint in here that it would need to be added to $form->data['modelID'] I do not see the also mentioned DB Connection tab anywhere.
could somebody pls help me out?
J!1.5.23; CF4 RC1.8
J!1.5.23; CF4 RC1.8
Hi chrissy6930,
The DB Connection tab is in CFv3.2; the update to the save should happen automatically in CFv4.
You do though need to add the new column to the table yourself; that isn't automatic.
Bob
The DB Connection tab is in CFv3.2; the update to the save should happen automatically in CFv4.
You do though need to add the new column to the table yourself; that isn't automatic.
Bob
ahhh! some things have simple solutions...
well I have now added all necessary fields to the form. however the db save wouldn't work anymore.
In trying to figure out what I messed up I set up a test form and as long as I stick to custom elements, date fields and select lists all is well. once I add a text field though db save won't work anymore. only why?
please find attached a screenshot of the connected table, a zipped php file with the wizardcode of the relevant form and a screenshot of the form on user side
details of events tab:
On Load:
Show html: yes-yes-yes-yes-no
On Submit:
DB Save: yes-jos_chronoforms_data_results-Results-no
Show Thanks message:
<dl id="system-message">
<dt class="message">Message</dt>
<dd class="message message fade">
<ul><li><?php echo JTEXT::_('Entry successfully saved.'); ?></li></ul>
</dd>
</dl>
Show html: no-yes-yes-yes-no
ETA: files removed
well I have now added all necessary fields to the form. however the db save wouldn't work anymore.
In trying to figure out what I messed up I set up a test form and as long as I stick to custom elements, date fields and select lists all is well. once I add a text field though db save won't work anymore. only why?
please find attached a screenshot of the connected table, a zipped php file with the wizardcode of the relevant form and a screenshot of the form on user side
details of events tab:
On Load:
Show html: yes-yes-yes-yes-no
On Submit:
DB Save: yes-jos_chronoforms_data_results-Results-no
Show Thanks message:
<dl id="system-message">
<dt class="message">Message</dt>
<dd class="message message fade">
<ul><li><?php echo JTEXT::_('Entry successfully saved.'); ?></li></ul>
</dd>
</dl>
Show html: no-yes-yes-yes-no
ETA: files removed
Hi chrissy6930,
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.
Bob
Hi crissy6930,
I think I've found the problem; or at least a large part of it.
Your text input Veranstaltung: has the input name 'event' and it turns out that this is a reserved word in ChronoForms. 'event' is used to define the form action and setting it to a different value in the form stops the form submitting correctly. If you rename it to, for example, 'eventx' then I think that the submission is OK.
I also noticed that PHP is not supported in the Show Thanks Message action so your JTEXT is not applied.
Bob
I think I've found the problem; or at least a large part of it.
Your text input Veranstaltung: has the input name 'event' and it turns out that this is a reserved word in ChronoForms. 'event' is used to define the form action and setting it to a different value in the form stops the form submitting correctly. If you rename it to, for example, 'eventx' then I think that the submission is OK.
I also noticed that PHP is not supported in the Show Thanks Message action so your JTEXT is not applied.
Bob
thanks bunches again! 8)
I've adjusted event for event_name and replaced the thanks message with a custom code item and now all is working.
you wouldn't mean there's more even of I do not see any more issues with it ?
I also have a couple more questions:
1) is there a way to add a custom order by (e.g. ORDER BY date DESC, group_select) ?
2) on my addresults form I would like to apply a custom validation if possible
a logic like this (or anything close) would be desirable:
if group_select = 1 set points to required
elseif group_select = 2 set grading to required
elseif group_select = 3 set both to required
I've adjusted event for event_name and replaced the thanks message with a custom code item and now all is working.
at least a large part of it
you wouldn't mean there's more even of I do not see any more issues with it ?
I also have a couple more questions:
1) is there a way to add a custom order by (e.g. ORDER BY date DESC, group_select) ?
2) on my addresults form I would like to apply a custom validation if possible
a logic like this (or anything close) would be desirable:
if group_select = 1 set points to required
elseif group_select = 2 set grading to required
elseif group_select = 3 set both to required
Hi chrissy6930,
I don't think that there is anything else . . . just being cautious.
There is no way that I know of to sort the ChronoForms DataViewer. You can use the EasySQL extension for Joomla! 1.5 to view and sort data - not sure if it runs on Joomla! 1.6 though.
I don't know if you can do 'live' validations in CFv4 (it was difficult in CFv3). I'll take a look when I can.
Bob
I don't think that there is anything else . . . just being cautious.
There is no way that I know of to sort the ChronoForms DataViewer. You can use the EasySQL extension for Joomla! 1.5 to view and sort data - not sure if it runs on Joomla! 1.6 though.
I don't know if you can do 'live' validations in CFv4 (it was difficult in CFv3). I'll take a look when I can.
Bob
There is no way that I know of to sort the ChronoForms DataViewer.
would there be a way for adjusting the default sort order? in source code somewhere? since I need the sort order to be identically in all forms with displayed data that would be a solution for me
I don't know if you can do 'live' validations in CFv4. I'll take a look when I can.
cool!
or - as an alternative - would there be a means for 'displaying' points and grading instead of 'setting them to required' if above conditions are true ? with points and grading being required by default ? and at the same time preventing a validation error to show for the respective non-displayed field ?
Hi chrissy6930,
I think that the Query is this line in admin.chronoform.php around line 421
You may want to upgrade to RC1.9 before hacking the core code though.
With the validations the problem is the same either way round - how to prevent hidden inputs being required.
Bob
I think that the Query is this line in admin.chronoform.php around line 421
$database->setQuery("SELECT * FROM ".$table_name." WHERE ".$primary."='".$_POST['cb'][0]."'");You may want to upgrade to RC1.9 before hacking the core code though.
With the validations the problem is the same either way round - how to prevent hidden inputs being required.
Bob
in RC1.9 in function show_data() I adjusted the above snippet for
only it does not appear to be making any difference. its still listed by cf_id ASC.
Would I have editing the wrong snippets ? its line 447...
on the validation matter I decided to go back to regular non-required fields scipping the select box. thanks for your advice🙂
$database->setQuery("SELECT * FROM ".$table_name." WHERE ".$primary."='".$_POST['cb'][0]."' ORDER BY `date` DESC, `group_select` ");only it does not appear to be making any difference. its still listed by cf_id ASC.
Would I have editing the wrong snippets ? its line 447...
on the validation matter I decided to go back to regular non-required fields scipping the select box. thanks for your advice🙂
found the solution:
all it takes is adding the ORDER BY to the WHERE field of the db multi loader
all it takes is adding the ORDER BY to the WHERE field of the db multi loader
Hi,
I have the same problem with DB multi record loader.
My ORDER BY was working until i enabled the "Enable Associations".
In my where statemenet there is a join that working very well, but when I add the ORDER BY, it causing no records to be retrieved.
See the code
I have tried all the compinations with '' or `` or model_id['field'] without any result. :?
Any help lightbulb will be appreciated.
Best regards
Takis
I have the same problem with DB multi record loader.
all it takes is adding the ORDER BY to the WHERE field of the db multi loader
My ORDER BY was working until i enabled the "Enable Associations".
In my where statemenet there is a join that working very well, but when I add the ORDER BY, it causing no records to be retrieved.
See the code
request_no = SproObject.id
order by request_noI have tried all the compinations with '' or `` or model_id['field'] without any result. :?
Any help lightbulb will be appreciated.
Best regards
Takis
Hi Takis,
I suspect that the problem is that with Enable Extensions on your ORDER BY gets put into the middle of the WHERE statement and breaks the SQL.
Please try turning Site Error Reporting on and see what the SQL query that is generated looks like.
The 'right' answer here is a modified action that supports ORDER BY correctly but that may be tricky to write.
Bob
I suspect that the problem is that with Enable Extensions on your ORDER BY gets put into the middle of the WHERE statement and breaks the SQL.
Please try turning Site Error Reporting on and see what the SQL query that is generated looks like.
The 'right' answer here is a modified action that supports ORDER BY correctly but that may be tricky to write.
Bob
Hi Bob,
Thank's for your reply and you are right
I solve this by having only one where statement.
But the right behavior should be adding the where statement of the associating query, not at the end of main query but in the beggining.
Can I ask another question pls?
From one page of my site I have a button to a form. In this page the url has a parameter ?id=106.
How can I call the form in order to fill the first field with that number?
I hope that my question is clear for an answer.
Regards
Takis
Thank's for your reply and you are right
Hi Takis,
I suspect that the problem is that with Enable Extensions on your ORDER BY gets put into the middle of the WHERE statement and breaks the SQL.
Bob
I solve this by having only one where statement.
But the right behavior should be adding the where statement of the associating query, not at the end of main query but in the beggining.
Can I ask another question pls?
From one page of my site I have a button to a form. In this page the url has a parameter ?id=106.
How can I call the form in order to fill the first field with that number?
I hope that my question is clear for an answer.
Regards
Takis
This topic is locked and no more replies can be posted.
