How to change the jquery mobile flip switch state from code

0 votes
I have some jQuery Mobile flip toggle switches on my Android/iPad application, and I need to change their states (on/off) dynamically, using JavaScript. I was looking for a solution here, (Change value of flip toggle dynamically with jQuery Mobile) and I tried several ways (.val('on'), .slider('enable')...) but it seems the control is not working at all.

Is there a solution for this issue? How can I do to change the flip switch state from code?
Aug 1, 2022 in Web Development by gaurav
• 23,260 points
716 views

1 answer to this question.

0 votes

I've examined the page you posted and I confirmed that the solution:

$('selector').val('value').slider('refresh');

does indeed work. Make sure that 'selector' is referencing your select element, and that 'value' is a value you defined on the option element you wish to enable.

answered Aug 1, 2022 by rajatha
• 7,680 points

Related Questions In Web Development

0 votes
0 answers

How to get mobile number from facebook login using jquery?

I am trying to work facebook login ...READ MORE

Jul 19, 2022 in Web Development by gaurav
• 23,260 points
812 views
0 votes
0 answers

How to get the value of a checkbox flipswitch in JQuery Mobile 1.4.5?

I'm using following markup to create a ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
526 views
0 votes
0 answers

How to stretch a GIF to fill the whole div using jQuery Mobile?

I'm using jQuery Mobile to create a ...READ MORE

Aug 22, 2022 in Web Development by gaurav
• 23,260 points
803 views
+1 vote
1 answer

How to access the Angularjs scope of a particular html element from our console?

Hello, You should follow the below steps:-- 1.Compile and ...READ MORE

answered Jan 21, 2020 in Web Development by Niroj
• 82,840 points

edited Jan 21, 2020 by Niroj 2,981 views
0 votes
1 answer

Horizontal scrolling and vertical scrolling in JqueryMobile

I'll go through code's main parts for ...READ MORE

answered Jun 21, 2022 in JQuery by rajatha
• 7,680 points
1,833 views
0 votes
0 answers

Page Reload/Refresh executes $(document).ready() on every page in jQuery Mobile

My jQuery mobile applications consists of multiple ...READ MORE

Jul 22, 2022 in Web Development by gaurav
• 23,260 points
936 views
0 votes
1 answer

Jquery Mobile go back button scrolls to top

I had this issue i fixed it ...READ MORE

answered Aug 5, 2022 in Web Development by rajatha
• 7,680 points
734 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,520 points
1,322 views
0 votes
1 answer

How to change an element's title attribute using jQuery

You can change the title attribute with ...READ MORE

answered Jun 30, 2022 in Web Development by rajatha
• 7,680 points
4,655 views
0 votes
1 answer

How to cast jQuery $.ajax calls to Bluebird promises without the deferred anit-pattern

jQuery have promises implemented with their AJAX ...READ MORE

answered Aug 1, 2022 in Web Development by rajatha
• 7,680 points
544 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP