1

I'm using PhoneGap and Sencha Touch to display a form. I'm using an image as the button to submit it:

<img id='submit' src='button.png' />

I'd like to then listen to it be clicked and validate the form. If I try the following it never seems to fire:

Ext.get('submit').on('click', validateFn);

Am I missing something obvious? Should I use <input type="image" ... />?

Update: For future viewers of this question it is worth noting that inconsistent click handling seems to be a bug or series of bugs in Android's WebView. There are several unresolved bugs on this topic.

pr1001
  • 21,727
  • 17
  • 79
  • 125
  • Should the Ext.get('submit') be Ext.get('#submit') or something like that? I am not totally familiar with Ext. – davejohnson Nov 08 '10 at 12:57
  • I'm not either. I'll check, because that would make me feel very dumb (but very happy) if that's the case. – pr1001 Nov 08 '10 at 22:12
  • Actually, only the format _without_ the `#` is supported. Good suggestion, though. – pr1001 Nov 09 '10 at 08:22

1 Answers1

2

Yes it do accept click events

Check this link and sample out

http://developer.android.com/resources/articles/using-webviews.html

DeRagan
  • 22,827
  • 6
  • 41
  • 50