Karthikeyan
Karthikeyan

Reputation: 1790

How to get Form Values in JQTouch:

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 () {

$('#msg').html($('input:textbox').val());

});

it works with JQuery but not in JQTouch.

Any Ideas People,

Thank u,

Upvotes: 1

Views: 490

Answers (3)

Kris Erickson
Kris Erickson

Reputation: 33854

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

Upvotes: 0

Jacob Oscarson
Jacob Oscarson

Reputation: 6403

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.

Upvotes: 2

Harmen
Harmen

Reputation: 22456

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.

Upvotes: 0

Related Questions