$select.find('option:selected').text()
should get the name of the selection:
jQuery(document).ready(function($) {
function updateGravityFormHiddenFields() {
var $select = $('#wpc-taxonomy-work_location-3945');
var selectedText = $select.find('option:selected').text(); // Get the selected option's text
console.log("Selected Name:", selectedText); // Debugging line
$('#input_3_14').val(selectedText).trigger('change'); // Ensure value update
}
// Initial population
updateGravityFormHiddenFields();
// Use .on() instead of .change()
$(document).on('change', '#wpc-taxonomy-work_location-3945', function() {
console.log("Change detected"); // Debugging line
updateGravityFormHiddenFields();
});
});
Related Posts:
- Help debugging PHP filter for wordpress [closed]
- Removing labels and tag on WordPress’s default login form
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- Shortcodes — Using add_action, add_filter in the shortcode
- How to remove medium size class in gravity form for input tag?
- WooCommerce Custom Product Validation [closed]
- Add Lightbox To WordPress Native Gallery
- WordPress add script with custom type (x-jquery-tmpl)
- need correction with a snippet in functions.php [closed]
- “The editor has encountered an unexpected error” After add defer tag to java script
- how to unescape wordpress output
- Add Index to Item in WordPress Gallery
- Change add_filter based on Ajax
- This code works, but breaks the media uploader. How do I integrate it in a way that won’t?
- How to apply_filter / add_filter within 2 others (simultaneous?) add_filter
- WordPress hooks/filters insert before content or after title
- What is the very earliest action hook you can call?
- Explanation for apply_filters function and its variables
- Query WP REST API v2 by multiple meta keys
- Removing Image and Caption Dimension Attributes
- How to modify Contact Form 7 Success/Error Response Output [closed]
- is it possible to add “extra” table nav to edit-tags.php screens?
- Editing ‘Password Reset’ E-mail
- add_filter and changing output captions of image gallery
- Filter media library items by size
- xmlrpc_enabled filter not called
- How to apply the “retrieve_password_message” filter?
- wp_mail – Remove sitename from email subject
- Remove left alignment option in core/image block
- How to change/rewrite the lost password url?
- add_filter multiple times with different addon functions?
- WP Rest API – Upload media without saving attachment post
- Using variable from one filter in another filter
- What effect does the_content filter have on performance?
- Change “You are now logged out” text
- Anyway to edit the titlebar of WordPress Widgets in the Admin area?
- add class to term_description
- How may I filter get_users() similarly to pre_get_posts?
- Using hooks to place content in theme dynamically
- How can I find out what an `apply_filter` call is actually doing?
- How to apply content filter permanently?
- remove other tabs in new wordpress media gallery
- wp_title() empty on a static front page
- Search pre_get_posts filter which can handle multiple post types and categories?
- End excerpt at the end of the sentence
- Customize the “Registration complete. Please check your e-mail.” message on WP 4.0
- posts_groupby problem
- Remove classes from post_class()
- How can I register a new REST context?
- How can I add a fifth option to the alignment picker?
- Customize WooCommerce Error Message
- How to stop WordPress from changing ellipsis into a pre-composed triple-dot glyph?
- Dump contents of a variable inside a filter/hook callback that runs during save post
- Customize user account activation message
- Conditionally call add_action depending on post_type?
- Right way to add HTML bloginfo name using a filter
- Allow users to exclude categories? (WP 3.1.2)
- Replace a part of url generated by get_term_link
- Error when overriding only some audio shortcode HTML output
- Filter category in WooCommerce shop page to display related sub-category
- Run oembed separately outside the_content()
- Hook Into the_content Filter For JSON API Only [closed]
- Allow EPS file upload – two EPS files have different MIME types
- Where can you find the available filter tags?
- Is possible dequeue/remove style from wp_footer() hook and add on wp_head() hook?
- How to call a function or method that is Namespaced using another plugin
- How to change currency programmatically on creating order action?
- Applying custom filter instead of the_content doesn’t render embeds
- Removing an action, or dequeueing style – Both not working
- Where is the changelog for 3.5? where is the list of added removed files?
- Change username before login
- De-bloating the page classes
- Move a file from a directory to another
- apply_filters(‘the_content’) – make it ignore shortcodes?
- Replace a word with a word in the URL string
- When does wordpress process <!–nextpage–>
- Remove style `?ver=` from `/wp-admin/upgrade.php`
- Add attribute to script loaded by the theme
- Redirect to checkout woocommerce failed
- Filter the regular price of woocommerce products
- remove action from AMP plugin
- Correct way to filter get_pages() function
- theme_page_templates not working
- wp_insert_post_data filter hook identify current action
- Add Class to a div using a filter?
- Filter custom post type using multiple taxonomy dropdowns
- Add new post with predefined / preset date
- Remove Actions added by SEO ultimate Plugin
- Modifying a CoBlocks Filter in Functions
- How to link the whole list item in Gutenberg’s latest posts block?
- Remove Extra Classes from Post Title
- Remove Content Filter
- views_edit-post filter not working (custom post type)
- Upload file if contains certain name
- Filters/Bulk Actions return wrong URL in admin dashboard
- I want to allow the use of a data-flw attribute in links in comments
- Building a request processor for multi-page forms, etc using $_GET requests
- How to know what filter to use and how to use it?
- Add a filter conditionally based on frontpage
- custom post filter based on Visitors country