I am attempting to input numeric values using a keyboard.
My issue is as follows: the keyboard has an "Accept" button, and I have multiple text fields. I want to assign a different action for each text field. I attempted to use multiple attribute selectors but it did not work.
<input id="txt1" type="text" /> </br>
<input id="txt2" type="text" /> </br>
<input id="txt3" type="text" /> </br>
$('input[type=text]').keyboard({
layout: "num"
});
$('.ui-keyboard').on('click', 'input[name="key_accept"]',function() {
alert('Accept button was clicked in text1');
// do your stuff here
});
You can view the example on this link http://jsfiddle.net/Mils/W2xFX/25/
The alert message appears for all text fields, but I wish to have a different alert for each text field.