Skip Navigation

[Résolu] Feature request: wpv-control – additional attributes

This support ticket is created Il y a 7 années et 11 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+02:00)

This topic contains 2 réponses, has 2 voix.

Last updated by Juan Il y a 7 années et 11 mois.

Assisted by: Juan.

Auteur
Publications
#402086

In the absence of a cred-keep-original option for views, would it be possible to have the Views developers add some additional attributes to the wpv-control shortcode?

Specifically, could we have a required attribute with options of (yes,no) and/or an onclick attribute so that we can trap empty form submissions when conducting parametric searches.

Use case example: User searching by postcode does not enter any postcode but search still returns results. Whilst logically an empty search says “get everything” in practice this can have unintended consequences such as when returning available pricing or service options.

If, however there is another eway to achieve this that I’ve missed can you point me in the right direction—thanks in advance….john.

#402088

Ok, I found a jQuery solution as follows that adds required to the input field.

jQuery( function( $ ) {
    $( "input[name='postcode']" ).prop('required',true);
} );
#402151

Juan
Supporter

Timezone: Europe/Madrid (GMT+02:00)

Hi John

Thanks for the feedback.

See, you were faster than me 🙂 we have some plans to improve the parametric search controls in the future, including the ability to customize how the form controls are displayed, and options for additional attributes, for sure. We will also be expanding our javascript API so you can put your own validation methods without a lot of effort. Please stay tunned 🙂

Regards.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.