2
votes

This one is killing me.

I have a fairly complicated JavaScript routine fired by a button click on a JQM form that functions fine in desktop browsers, but does nothing at all in PhoneGap (all platforms).

The JQM code I'm using to fire the script is:

<input type=button value="Submit" onClick="function(blah,int);">

Which works fine everywhere else...

I've tried various ways of doing this including input type="submit" and moving the function call to the form tag for post, ensuring that all links leading to the page have data-rel="external" set to move out of the main page DOM... nothing makes any difference. What makes a button die in PhoneGap but work in all desktop browsers?

1
maybe phonegap reserves int as a keyword.sissonb
Is there a particular reason you don't wrap button in quotes?Daedalus
sissonb - "int" is placeholder here, my client requires an NDA, lolspacemoose1
Daedalus - Forgot to add quotes here, have them in the code.spacemoose1
Its a long shot, but have you tried changing value="Submit" to something else like value="Send" ?Peter Smith

1 Answers

0
votes

Turned out to be a minor permissions issue in my phonegap setup. Go figure.

<input type="button" value="Submit" onClick="function();">

Works just fine to fire JS from a JQM form so long as you allow phonegap to access external pages if you're working with resources outside of the app.