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 in Web Development by gaurav
• 17,580 points
15 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 by rajatha
• 7,040 points

Related Questions In Web Development

0 votes
0 answers
+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,740 points

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

How to upload zip from the S3 bucket to lambda function using AWS CLI

Hi@Abhishek, You want to upload your zip file ...READ MORE

answered Apr 10, 2020 in Web Development by MD
• 95,360 points
4,442 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 in JQuery by rajatha
• 7,040 points
26 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 in Web Development by gaurav
• 17,580 points
15 views
0 votes
1 answer
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,500 points
308 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 in Web Development by rajatha
• 7,040 points
21 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 in Web Development by rajatha
• 7,040 points
13 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP