Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.2.6, extension, form, input mask
- This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by
Steven Zahm.
-
AuthorPosts
-
05/11/2015 at 1:07 pm #333923
Rocky Losli
ParticipantI am having trouble getting the phone field to be masked. I added the following code to the head section of my theme:
(script type=”text/javascript” src=”https://raw.githubusercontent.com/digitalBush/jquery.maskedinput/1.4.0/dist/jquery.maskedinput.js”)(/script)
(script type=”text/javascript”)jQuery(document).ready(function ($) {
$(“.cn-phone”).mask(“(999) 999-9999”);
});(/script)*Replaced < with (
I added the class “phone” to the field which renders as .cn-phone in the browser.
From class.metabox-entry.php:
echo '<div class="widget-inside">'; cnHTML::field( array( 'type' => 'text', 'class' => 'phone', 'id' => 'phone[::FIELD::][number]', 'required' => FALSE, 'label' => __( 'Phone Number', 'connections' ), 'before' => '', 'after' => '', 'return' => FALSE, ) );Any ideas?
05/12/2015 at 9:46 am #333985Steven Zahm
Keymaster@ Rocky
Since the phone number field does not exist until the add phone button is clicked the input mask added by the Masked Input will not be applied. This is because it is only being applied to fields which exist on the documented loaded event.
What you need to do is edit the JS for Form,
cn-form-user.jsandcn-form-user.min.jsto add the Masked Input to the fieldaddfunction. I think simply adding$('.cn-phone').mask('(999) 999-9999');as the last line to theaddfunction will be enough.Hope that helps!
05/12/2015 at 11:41 am #333995Rocky Losli
ParticipantThank you. That worked a treat.
Cheers!
05/13/2015 at 11:33 am #334130Steven Zahm
Keymaster@ Rocky
Great to hear!
If you have a moment, I would truly appreciate a review. Many thanks in advance!
https://wordpress.org/support/view/plugin-reviews/connections
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
