Skip Navigation

[Resolved] show NUM keyboard 0-9, use bootstrap btn with edit-post-ink, user ctf filter

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a phone custom field, and when entering a value I would like to show the number keyboard input instead of the alphanumeric keyboard input.

Solution: You can use custom code to modify the input type:

( function( $ ) {
    $( document ).ready( function(){
 
        $('input[name="wpcf-should-be-number"]').prop('type','number');
    });
})( jQuery );
This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 3 voices.

Last updated by Christian Cox 6 years, 7 months ago.

Assisted by: Christian Cox.

Author
Posts
#920351

hi,
i need help with to follow questions:
1. in input field at mobile phone i want to popup NUM keyboard 0-9.

2. i have tryed to use this string the user name and last name don't show.
[toolset-edit-post-link layout_slug="report-vote"]<button class="btn-voter" type="button">[types field='first-name'][/types] [types field='last-name'][/types]</button>[/toolset-edit-post-link]

3. i have made custon user field "obs-polw-number" and i want to use it as a value in form filter.
[wpv-control-postmeta field="wpcf-poll-number" type="textfield" url_param="wpv-wpcf-poll-number" value="obs-polw-number"]

please advice.

thanks
rotem

#920700

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

Please note that we have a single-issue-per-thread policy in the forums to make it easier for other users with similar problems to find solutions. I'll post some quick responses to your questions here, but if they need following-up I'll need to split them into separate threads.

1. You need to change the input type from text to phone on the input field in your form. We are going to update the Types fields to use more specific field types where relevant (e.g. email type for email field) but in the meantime the only way you can do this is by switching the input type with a little JavaScript once the form has been rendered.

For a Types field "should-be-number" you could add the following to your Form custom JS:

( function( $ ) {
	$( document ).ready( function(){

		$('input[name="wpcf-should-be-number"]').prop('type','number');
	});
})( jQuery );

(Note how Types field names have a 'wpcf-' prefix.)

2. Shortcodes are not parsed inside the toolset-edit-post-link shortcode, what you are aiming to do is not possible. The only dynamic text available is from the %%POST_TITLE%% and %%POST_ID%% placeholders.

3. If you have a View that queries posts then you can only filter by custom post fields, not custom user fields. Custom search Views are only available for posts, not for users or taxonomies.

We have a document about mimicking custom search for users that may be helpful: https://toolset.com/documentation/user-guides/how-to-create-custom-searches-and-relationships-for-users/

#921840

thank you fir the code it's working great.

let say i have a field that gets #1 or #2 or #3 value.

how can i filter custom post by user?
i want to show to user A just post that have the value 1.
and to other user just the psot that have the value 2 and on...

please advice.

thanks rotem.

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/different-views-filters-for-different-users/

#922600

Hi, I have split your new question into a separate ticket so we can discuss in more detail. Thanks for helping us keep the forum organized!