开发者

How to get Form Values in JQTouch:

开发者 https://www.devze.com 2023-01-22 22:41 出处:网络
HIi friends, i working on a IPhone Web App as its kinda new to me, have studied some basics of JQuery,

HIi friends,

i working on a IPhone Web App as its kinda new to me, have studied some basics of JQuery,

i want to get the form value in one view and to return to next view,i have tried this one,

$("button:#Get").click(function () {

$('#m开发者_开发百科sg').html($('input:textbox').val());

});

it works with JQuery but not in JQTouch.

Any Ideas People,

Thank u,


jQTouch isn't essentially very different from a normal jQuery Js-based app. If you can set ID's on your form elements you can access them the usual way.

Demonstration:

  1. Go to the demo at http://www.jqtouch.com/preview/demos/main with a WebKit based desktop browser, click "User Interface' -> 'Forms' and open up your developer tools.

  2. Type something into the topmost text field. Now go to the console in the developer tools and write $('#some_name'). You should see a normal jQuery node.

  3. Type $('#some_name').val(). You will see the text you typed in (2).

Try some more experiments, you'll see that it works much the same as a normal jQuery-based web app.


This is just a guess:

$("#Get").click(function() {
  $('#msg').html( $('#specificInputfield').val() );
});

I think you need to specify which value of which input field you want to select, because your current selector will select all text input fields.


Have you tried 'tap' instead of 'click'?

0

精彩评论

暂无评论...
验证码 换一张
取 消