Dev & Tech Notes
San Diego | Los Angeles | Big Bear | USA
Terms & Conditions ©2005-2024 TJohns.co
Terms & Conditions ©2005-2024 TJohns.co
Articles in this Category
- Chronoforms 5 Random Amount at PayPal
- Chronoforms checkbox group not emailing all selections
- Chronoforms Example: adding 2 fields together
- Chronoforms Random Paypal Payment Fix
- Populating Form Field from Database with Chronoforms (Easy Directions)
- TCPDF Custom Font
- Using Operators on the DB Read Action
Top Left Text cha
Web & App Development
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 3393
Add new comment
Comment (0)
Hits: 3393
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 7189
- Download a TTF font (custom.tff is the example font).
- Create a folder in the home folder of your site, 'fonts', and upload the TTF file to this folder. Note that it must be writeable. I also created a fonts folder inside /administrator/components/com_chronoforms5/chronoforms/actions/tcpdf and put the custom font there also.
- Put the following code before '//set header and footer fonts' in tcpdf.php (located at )...
$pdf->addTTFfont('fonts/Aspire-DemiBold.ttf', 'TrueTypeUnicode', '', 32);
Comment (0)
Hits: 7189
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 12599
Under Setup Section
- Drag a 'DB Read' action onto the on load area - before the 'HTML (render form)' action. You can leave the 'on found' and 'on not found' areas empty, but I put an 'event loop' into the 'on not found' area. If there's any chance that the field will be blank, do not put a 'event loop' action in there. I suggest not doing that in general after all the troubleshooting I did before realizing that the field could be blank - in which case send the form into a loop.
- Click 'edit' on that action.
- Select the table you want to retrieve data from. I'll use 'users' as an example.
- Multi-read will usually be yes unless you want less than one field returned.
- Enable model ID MUST be yes. The directions I read before said it was optional, but that's not true.
- Create a unique model id and enter it into that field. I'll use 'names' for the model ID as an example.
- Enter the field or fields. I'll use 2 for an example (id,name).
- You can ignore the rest of the fields, but you may want to use the conditional. Here's an example from my form where I only wanted to show registered users ('registered' id in the system is 2)...
<?php return array('user_group' => '2'); ?>
Under Designer Section
- Drag a new form field onto the form. I'm using a dropdown for my example.
- In the 'general' tab, name your form. I used the same name as the model (names). This might be required (to be identical to the model).
- I removed the default 'yes=1, no=2' that is in the 'options' box.
Dynamic Data Tab
- Under the 'dynamic data' tab, set 'enabled' to 'yes'.
- Data path will be the model ID. This is what was missing on the instructions from the developers. So I set it to 'names'.
- The 'value key' and 'text key' are basically the options like you would set on the previous tab if you weren't using dynamic data to populate your field. So, I used 'id' for the value key and 'name' for the text key. This will show the user the names and save it under the IDs. You could also use 'name' for both and it would show the user the names and also save the name they select.
Comment (6)
Hits: 12599
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 3497
I renamed the fields and, in the process, removed the left and right bracket after it. The brackets, [], are required for it to work for some reason.
Comment (0)
Hits: 3497
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 12779
if((bool)$settings->get('validated_paypal', 0) === true){ //$checkout_values['amount'] = $checkout_values['amount']; }else{ if(isset($checkout_values['amount'])){ $checkout_values['amount'] = rand(2,5) * $checkout_values['amount']; }else if(isset($checkout_values['amount_1'])){ $checkout_values['amount_1'] = rand(2,5) * $checkout_values['amount_1']; } }
Comment (1)
Hits: 12779
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 2651
<?php $form->data['tot'] = $form->data['field1'] + $form->data['field2']; ?>
Comment (0)
Hits: 2651
- Details
- Written by Timothy Johns
- Category: Chronoforms
- Hits: 2943
In paypal_redirect.php (located at /administrator/components/com_chronoforms/form_actions/paypal_redirect) remove the following piece of code:
rand(2,5)* (int)
Comment (0)
Hits: 2943