I am a plugin called contact form 7 for contact us page. I have date picker in it. It is not working in firefox but working in chrome. How can I fix this error ? Can anyone the solution for this problm ?
The answer from #Christophvh was right but incomplete. The datepicker calendar is here but not visible. There seams to be a bug in the jquery datepicker that sets an incorrect z-index value thus making the calendar hidden behind the form.
Here is how I made it work :
1) Enable WCF7 fallback but putting this code snippet in your theme functions.php file
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
2) Fix the bug by putting this code snippet in your theme functions.php file, or by editing you theme CSS if you know how to :
add_action('wp_head', 'replacethiswithyourthemename_wcf7_datepickerfix');
function replacethiswithyourthemename_wcf7_datepickerfix(){
?><style>#ui-datepicker-div {z-index:99!important;}</style><?php
}
Contact form 7 uses HTML5 for this, functions like Datepicker are not supported by some browsers. The following answer is from the FAQ page http://contactform7.com/faq/
Does Contact Form 7 support HTML5 input types?
Yes. Contact Form 7 3.4 and higher support form-tags corresponding to
these HTML5 input types: email, tel, url, number, range and date.
If you don’t wish to use HTML5 input types, you can disable this by
adding the following code into your theme’s functions.php file: 1
add_filter( 'wpcf7_support_html5', '__return_false' );
Note that even the most current browsers partially support HTML5. For
example, the latest Firefox doesn’t support the date input type (that
allows you to choose a date from a calendar user interface) and the
number input type (that allows you to input a number value from a
spinbox UI) yet — so Firefox provides a general text input field as a
fallback instead of a calendar and spinbox UI. This may confuse users
because they can’t detect what type of input value this field expects.
So, you may feel that it is better to wait for all browsers to support
all HTML5 features completely.
But you don’t need to wait! Contact Form 7 offers a better solution.
Contact Form 7 is able to provide jQuery UI-based fallback for the
date and number input fields. By using this solution, you can provide
calendar UI for the date field and spinbox UI for the number field,
respectively, even with Firefox or Internet Explorer.
By default, this fallback feature is disabled because it loads extra
JavaScript and CSS (makes for poor performance) and it is only
necessary for websites that use the date or the number input fields.
If you use the date or number input fields and wish to use this jQuery
UI-based fallback feature, add the following code into your theme’s
functions.php file and activate the feature: 1
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
So in your case adding
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
will work if you install jquery UI, which you can find here: https://jqueryui.com/
Related
I want to set the autocomplete to new-password only on the billing address 1 (street address) field so the modern browsers don't give the option to autofill on that field.
Is there a way to do it through a WooCommerce function?
What I have tried so far?
So looking at the output of the woocommerce_checkout_fields, I see the autocomplete is present (see screenshot below). I have tried to change it with the code below but it doesn't work. Maybe I am doing it wrong?
function custom_override_checkout_fields( $fields ) {
$fields['billing']['billing_address_1']['autocomplete'] = 'new-password';
return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
Also, I found this on Woocommerce - Turn Off Autocomplete in Checkout Fields via "autocomplete=new-password" where all fields have been set to new-password, but I don't think it's a nice solution (it changes all the fields).
Thanks to Vijay's comment I started to investigate what could be the cause of the issue. Found out my code works, it was the address autocompletion JS added by Google Places API that's setting the autocomplete attribute to off.
I will contact Google Developer Console support to see if there's a way to mitigate this.
I am using the Avada theme on my WordPress which makes use of Countdown Boxes, constructing pages using the provided Fusion Page Builder. The countdown box will show the number of days to a certain date which is output through a plugin called Days-Until. Syntax for implementing this: [days_until date="15 April 2015"].
I am trying to use this Days-until shortcode and pass the value to the countdown box shortcode using the Fusion (WYSIWYG Editor):
[counters_box columns="4" color="" title_size="" icon_size="" body_color=""
body_size="" border_color="" class="" id=""][counter_box value="[days_until
date="4 April 2015"]" unit="" unit_pos="suffix" icon="" direction="up"]"
unit="" unit_pos="suffix" icon="" direction="up"]Text[/counter_box]
Unfortunately the code doesn't work, and the following is displayed.
0 (in the counter box)
unit=”” unit_pos=”suffix” icon=”” direction=”up”]” unit=”” unit_pos=”suffix” icon=”” direction=”up”]Text
Is it even possible to do what I'm trying to do?
Thanks
It's not possible to nest one shortcode inside another (i.e. your days_until shortcode inside the counter_box) without some programming.
It's a commercial theme so we're unable to see the original PHP code.
What'd you need to do is edit the code for counter_box so it calls do_shortcode on the value parameter.
do_shortcode is a function that expands any shortcodes in the supplied text (in the same way they are if they've been pasted into the content field of a Page or Post), so the days_until code will be converted to a number that the counter can use.
I would suggest getting in touch with the theme developer.
Further reading: WordPress Shortcode API
I have installed a "Contact Form 7" plugin on following WP blog https://vsupholstery.com/ and I have added date field inside that form (form is located below slider). The problem was that the date field was not functional inside Firefox, IE and Safari, so I installed the additional plugin from this page http://wordpress.org/plugins/contact-form-7-datepicker/ . Now the date field is working OK and it shows the calendar when you click inside date field, but the calendar style does not work.
Any idea how to fix this problem since I tried many things and nothing works.
Thanks.
Please add below code in your theme's functions.php
add_filter( 'wpcf7_support_html5_fallback', '__return_true' );
I am trying to add http:// in the post link dialog box if there is not already added. I tried with filter
add_filter('pre_link_url', 'add_http_link_url');
It didn't work. Does anybody know how to do that ?
Doesn't Wordpress automatically add the "http://" there by default?
Maybe this plugin would help?
wordpress.org/extend/plugins/auto-hyperlink-urls/
EDIT
found this on http://betterwp.net/wordpress-tips/make-links-clickable/
a function named make_clickable() that can be found in wp-includes/formatting.php.
make_clickable() filters the comment_text hook with this:
add_filter( 'comment_text', 'make_clickable', 9 );
Since it is that simple, let’s try adding the same filter to our post contents and see if it works
add_filter( 'the_content', 'make_clickable', 12 );
The priority of 12 as used above simply tells WordPress to make links clickable for post contents after shortcodes are parsed (which is at priority 11). If you don’t like such behaviour, just change 12 to any number you want. You should take a look at wp-includes/default-filters.php to choose an appropriate priority for make_clickable().
Being that awesome, however, make_clickable() has a limitation, which you can clearly see in this clickable link: http://codex.wordpress.org/Function_Reference/make_clic ... _clickable.
See the full stop punctuation mark also included in the link, thus making it broken? To avoid such behaviour you must always have one space plus another character after a plain link, or in other words, never put a plain link like that at the end of a paragraph. In case you must, just make the link clickable the normal way .
Of course if you don’t like your visitors to be able to post links that way you can easily remove the filter using:
remove_filter('comment_text', 'make_clickable', 9);
hope this helps, sorry i had to remove the first link as i can only post 2 links till i get my rep up :)
I don't know how to change the size of the login username/password boxes on the drupal site that I'm trying to build. I'm stumbling through the theming, and don't know where to find the file that needs to be changed in order to have boxes that fits the aesthetic (so a file path would be very helpful).
I'm hoping it's a css solution. You can see the site first hand at innovatefortomorrow[dot]org and my firebug screenshot http://www.jonrwilson.com/user-login-form.png (I don't have enough reputation points to attach an image or two hyperlinks).
Thanks!
read this as well! This is an alternative answer!
Ok... you are about to enter one of the most exciting and complex features of Drupal: the form API or - for brevity - FAPI. Some theory first, and then the solution! :)
All forms in Drupal are built by the drupal_get_form() function, that accepts an array as parameter. Each field in the array is basically a field of your form, and each field has a number of proprieties, each of them define additional characteristics of the the field, like for example its default value, if it is required or optional and - yes - in the case of textfields... how large they have to be! You can find a detailed explanation of the structure of form arrays here on the drupal site.
The beauty of the form API is that the function that renders the form invokes a number of hooks at various moments during its building process, so you can implement these hooks in order to "alter" a form before it is finalised and sent to the browser.
The most commonly hooks for form alteration are hook_form_alter() and hook_form_FORM_ID_alter(). The first is executed for any form processed by the drupal engine, the latter only for the specific form named "FORM_ID". I will not get into any more details on the internal working of the form API, but here you can read more.
As for your specific case, I assume you are using the standard "user block" shipping with Drupal. In this case I suggest you implement hook_form_FORM_ID_alter() in a form similar to this one:
mymodule_form_user_login_block_alter(&$form, $form_state) {
$form['pass']['#size'] = 43;
}
Hope this helps! :)
I think in this case you have to go to the your html ( or tpl), not your css file to edit it.
One quick way is to search the relevant string (i.e., size="43" name="name" etc) in order to find the correct part.
Here is the way to theme a user login form in drupal 6 with the preprocess function in a template file and not in a module.
in template.php put this code:
function yourThemename_preprocess_user_login(&$variables) {
$variables['form']['name']['#size'] = 15;
$variables['form']['pass']['#size'] = 15;
$variables['rendered'] = drupal_render($variables['form']);
}
create a new file user-login.tpl.php (if it's not already there) and just paste this:
<?php print $rendered; // this variable is defined in the preprocess function user_login and print the login form ?>
Don't forget to clear theme cache or system cache in the performance settings.