The form reloads itself each time you save returning to the initial state where all are shown. What you can do is this:
// Getting the value of the selected field
var my_select_value = $('#widgets-right select.my-select').val();
// If there's no value selected, hide everything.
if(my_select_value == 0){
$('.widget-test .row').hide();
}
// Otherwise, show the specific rows
if(my_select_value == 1){
$('.widget-test .row').hide();
$('.widget-test .row.one').show();
}
if(my_select_value == 2){
$('.widget-test .row').hide();
$('.widget-test .row.two').show();
}
if(my_select_value == 3){
$('.widget-test .row').hide();
$('.widget-test .row.three').show();
}
At the initial stage of the JavaScript.
Related Posts:
- Enabling jquery when dragging available widget to sidebar area
- How do I rebind event after widget save
- How to listen to color changes on the color picker?
- Add a select box to all widgets
- Ban certain widgets from certain sidebars
- Widget “Save” resetting jQuery hidden fields
- jQuery does not work in widget backend
- Trigger Submit Event when Widget is added to Sidebar
- Custom widget using get_categories select menu dropdown
- How to enable “shift-click to edit this widget” functionality on a custom widget?
- Using jQuery in widget development
- cannot drag and drop widgets since wordpress 3.2.1
- AJAX Contact Form Issue
- jQuery UI inside widget on admin page
- WP_enqueue_script() loads them always in wp_footer()?
- Wrap the widget content with a div and get the widget title outside? [closed]
- Access Customizer widget instance form
- How i can widget ID get after drag for wordpress with jquery?
- wordpress widget missing jquery
- Widget select option not saving
- In widget, the value of select field doesn’t get updated, changes after saving
- Jquery checkbox -show posts with checked tags
- SELECT field options disappear when saving widget
- Using AJAX in WordPress Widget
- Custom tabs widget don’t work in google chrome, is blocked, do not change the tabs. Why?
- Multiple widgets in wordpress
- jQuery “on” handler does not fire on newly inserted widgets [closed]
- Using AJAX in a Widget to Sort items [closed]
- Limit number of Widgets in Sidebars
- check if registered sidebar is active & has widget content
- $post>ID displays wrong post ID
- Programmatically edit the text of a widget
- Video Embed in Sidebar Widget with Links to Others in Category
- Shortcode from a widget is wrapped in unwanted element
- Bookshelf plugin and/or widget [closed]
- How to update widget from widget() function?
- Add a banner to the Dashboard
- Unable to get Alert function to consistently work with backend widget with latest WP
- Widget options get
- add_page_menu to make shortcut to widgets
- Insert custom content before widget title/after widget opening tag
- Ajaxing function in widget class
- Custom Menus, Widgets & Conditional Statements
- Dynamic widgets
- Show widget when not using SSL
- How/where is the global variable $wp_registered_widgets filled?
- Converting a WordPress widget to a block
- Change recent posts widget title
- How can I use AJAX to save/update a widget form?
- Display assigned terms with link
- Hide all Dashboard Widgets (not remove)
- Making footer widgets responsive
- Form link throwing website to main language
- Is there a way to extend the default image widget into a new custom widget and add additional fields to it?
- Create widget in dashboard displaying a custom user field?
- How can I inject options into an select tag inside the widget form?
- Widget without DIV wrapper
- Widgets not displaying since 4.3
- How to update the widget form when the image is selected?
- displaying tags in a widget
- Displaying a WordPress widget by name
- How to use wordpress content class?
- How to use get_results() in widget front end?
- Proper approach to moving complete site from one domain to another AND preserve widgets
- Different widgets in sidebar on sub-children pages?
- Why custom widget won’t appear in Block editor (Gutenberg)?
- A/B test options at the widget level [closed]
- Custom CSS for a particular text/html widget in WordPress
- Removing side bar widgets from GovPress theme
- Adding a single text input field to a custom Dashboard widget
- how to show only particular category post in archive widgets
- How to test if the widgetized area has any widgets?
- Saving widget gets an undefined variable
- Distinguish between different widgets of the same type
- Limit archive widget results
- How can I detemine the parameters needed by the_widget()?
- widgets in footer?
- Can you hide a widget based on its content?
- Fatal error: Uncaught Error: Class ‘WP_Widget’ not found
- Array showing all values of loop instead of specific value to post
- How can I remove WordPress element IDs and Class names in the HTML?
- Widget not appearing in customizer
- Widget settings disappear after refresh
- How to display author meta in a sidebar widget
- Is it ok not to set widget in the main page of a one page WordPress Theme?
- Recent Posts Widget URL / Domain change
- Make a widget to my footer
- How to change text of a widget depend on condition?
- Display Posts by Views (Popular Posts Widget)
- Default WordPress widgets always appear
- Add space to the end on a widget
- Show editor widgets only on pages that use a specific template?
- Options page for widget
- user definable sidebar per page
- List.js inside WordPress widget
- Show or hide custom menu widget in side bar conditionally
- Post Thumbnails on Sidebar Widgets
- Widget which displays thumbnails, but links to urls?
- Using Conditional Tags to restrict something to 1 user?
- Problem on register/login widgets