pbosakov
Forum Replies Created
-
Hi, the script itself looks right to me at a first glance. Where in the document body is it placed? Maybe it gets executed before the form fields are available in the DOM. You can try wrapping it in a document.ready event handler, like this:
<script>jQuery(document).ready(function(){ /* Your code here */ });</script>
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] Multiselect CheckboxesHi, at the moment neither the free nor the Pro version supports grouped checkboxes. You may, however, use multiple individual checkboxes with the “exclusive” flag enabled on each.
Support for checkbox groups is on the feature list for future releases.
Forum: Plugins
In reply to: [PVB Contact Form 7 Calculator Add-on] How to do auto calculationHi,
Yes, auto calculation is possible. Please check section 5 (“Scripting”) in the documentation.This is the full code block that outputs some Javascript code, with my added line that will disable the “amount” field when “other amount” is selected.
$output .= <<<EOT <script type="text/javascript"> jQuery(document).ready(function($) { $('.wp_accept_pp_button_form_classic').submit(function(e){ var form_obj = $(this); var other_amt = form_obj.find('input[name=other_amount]').val(); if (!isNaN(other_amt) && other_amt.length > 0){ options_val = other_amt; //insert the amount field in the form with the custom amount $('<input>').attr({ type: 'hidden', id: 'amount', name: 'amount', value: options_val }).appendTo(form_obj); $('select[name=amount]').prop('disabled', true); } return; }); }); </script> EOT;
I believe my post above answers your question and resolves your issue. If you think this plugin is a good fit for what you want to achieve, please consider trying it out on your website and leaving a review. Thanks!
Hell, thank you for your interest in this plugin.
Currency conversion is a useful feature and I will consider a direct implementation for a future release.
In the meantime, you can use the “wpcf7calculate” jQuery event which is triggered on the form after calculation. This means that you can code your own Javascript function and place it somewhere on your site to generate links and perform further operations.
Here is an example:
<script type="text/javascript"> jQuery(function($) { $('form').on('wpcf7calculate', function() { var dollars = jQuery('input[name=total]').val(); var euro = currencyConvert(dollars, 'USD', 'EUR'); if (euro === false) { alert('Currency conversion failed'); } else { alert(dollars + ' dollars = ' + euro.toFixed(2) + ' euro'); } return; }); }); function currencyConvert(amount, from, to) { var result = ''; var convertUrl = "https://free.currencyconverterapi.com/api/v3/convert?q=" + from + "_" + to + "&compact=ultra"; var rate = false; jQuery.ajax({ url: convertUrl, async: false, type: "GET", dataType: "json", success: function (data) { rate = data[from + "_" + to]; } }); return rate ? parseFloat(amount) * parseFloat(rate) : false; } </script>
Forum: Reviews
In reply to: [PVB Contact Form 7 Calculator Add-on] devOK. Sorry.
Forum: Plugins
In reply to: [Stray Random Quotes] Can’t edit and new quotes are emptyHello all,
While I too would recommend prepared queries as a more elegant and more secure solution, if you are short on time, the quick and easy way would be to replace all occurrences of
mysql_real_escape_string
withesc_sql
in stray_manage.php.I had the same problem, my solution was to add
'suppress_filters' => false
as an argument to theget_posts()
query.Hopefully we can see that in a future release?
The current version uses TimThumb 2.8 which is better than the older versions, but still not 100% safe. I’d recommend to upgrade to the newest one ??
The author seems to be actively monitoring this forum, so I’m sure he’ll see it. I wasn’t able to find any other contact info.