I have a form. In this form there is an input area. When the user selects the input they are taken to one of three places depending on which device they are using. android - google play store, iphone - itunes store, desktop - itunes web browser. I am able to retrieve the iphone and desktop states, however Android doesn't seem to work on the form tag with an action attribute. The links work fine. Not sure what the issue is. Summary -- when I click the input button, nothing happens, no pop ups, nothing on my android. Also when I place the url of http://www.google.com into the action attribute of form it works correctly. Something is happening in between.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name='viewport' content='initial-scale=1'>
</head>
<body>
<div class='main'>
<br/>
<br/>
<br/>
<form id="store-link" >
<input type='submit' value='Download'/>
</form>
<br/>
<br/>
<br/>
</div>
<div class='footer'>
<p>footer</p>
</div>
</body>
<script>
var a = document.getElementById('store-link');
if (navigator.userAgent.match(/Android/i)) {
a.action = 'http://www.google.com';
}
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))){
a.action = 'itms://itunes.apple.com/us/app/peanuts-storygif-christmas/id1181016912?mt=8';
}
else {
a.action = 'https://itunes.apple.com/us/app/peanuts-storygif-christmas/id1181016912?mt=8';
}
</script>
</html>