Skip Navigation

[Resolved] Auto save when select field value change

This support ticket is created 2 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Shane 2 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2155503

I have a form with only one "select" dropdown field.
Is it possible to automatically submit the form every time the select field's value is changed?

Thanks

#2155635

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

This is not possible by default but you should be able to achieve it by using some javascript to trigger the action.

You can use the link below as it provides an example on how to do this.

https://stackoverflow.com/questions/28122019/how-to-submit-form-on-select-change/35418634

Please let me know if this helps.

Thanks,
Shane

#2155703

I was trying

jQuery("input[type='select']").change(function() {
jQuery(this).submit();
});

but somehow I cannot get it work.

Do I miss something?

#2155721

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Can you try this.

jQuery(document).ready(function() {
  jQuery('input[type='select']').on('change', function() {
    var $form = jQuery(this).closest('form');
    $form.find('input[type=submit]').click();
  });
});

Please let me know if this works.
Thanks,
Shane

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