If you a web developer, maybe you encountered this annoying thing. Let’s say you need to write a list of choices, i.e. questions – answers. Let’s define that all the questions are optional and you can select just one answer per question. The way you should implement it, is using inputs with radio type, that’s fine and this how it should be.Example code is: But, as I said, the questions are optional. What’s happening now is when I check an option, I cannot uncheck it anymore! A problem. What is favorite time? Morning Noon Evening What is your preferable paying method? Credit Card Check Paypal Cash Here, I will show you how to solve this problem.There are two solutions to solve it, both involves JavaScript (and jQuery to ease the work): Convert all radio buttons to checkboxes: What is favorite time? Morning Noon Evening What is your preferable paying method?…

Read more

I spent hours to find out how to do it. And believe me or not, I found nothing on the internet about how to solve it. So I wrote my own solution. It appear that there is a very simple way to achieve this. After the event deviceready has been triggered (as described on the PhoneGap’s API Docs), all you have to do is: When the deviceready event is being triggered, it tell us that all native components are loaded and are ready to use. Which means, that there is no way to determine whether the page was loaded from PhoneGap or not, using the PhoneGap plugin itself. You can always test against browser’s User Agent, but it isn’t a good verification, because it is always possible to open this same page through mobile’s browser, that have the same User Agent as the one that has been loaded from PhoneGap.…

Read more

2/2