Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6558483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:12:19+00:00 2026-05-25T13:12:19+00:00

I currently have a form with a ‘select’ input in it. When the user

  • 0

I currently have a form with a ‘select’ input in it. When the user selects an option, I want the form to submit automatically.

Here’s my current code:

<form method="get">
    <select name="category" data-native-menu="false" onchange="this.form.submit()">
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
    </select>
</form>

Currently, when a user selects one of the options, the form is submitted. However, it is submitted without ajax.

So, is there a jQuery Mobile specific function I have to call to get the form to submit via ajax, as forms by default do when they are submitted using a submit button?


Edit:

Here’s the solution I found:

<form action='myPage' method="get" id='myForm'>
    <select name="category" data-native-menu="false" onchange="$.mobile.changePage( 'myPage', {type: 'get', data: $('form#myForm').serialize()} );">
        <option value="1">Option 1</option>
        <option value="2">Option 2</option>
    </select>
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:12:20+00:00Added an answer on May 25, 2026 at 1:12 pm

    Try something like this to get the FormData object:

    var formData = $('form')[0].getFormData()
    

    Alternatively, check out the serialize doc from jQuery’s documentation:

    $('form').submit(function() {
        alert($(this).serialize());
        return false;
    });
    

    The return false prevents the form submit handler from firing. Instead of alert, do something with the data (stick it in you ajax handler, for example).

    Edit:

    The OP said the problem was solved by reading this page: http://jquerymobile.com/demos/1.0b3/docs/api/methods.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We currently have a form with the standard multi-select functionality of here are the
I currently have a form with a disabled submit input. In firefox 4.0, if
I currently have a form that lets a user select an image. After the
I currently have form that checks if a user has unsubmitted changes when they
Currently I have two pages: The first page contains an input form, and the
Currently on my application I have a form where I ask the user to
I currently have a JSP page with a Form for the user to enter
I currently have code similar to this for a form: $('#some-form') .submit(function() { //
I currently have a form with about 13 buttons on it. I want to
I have an Ajax form that sends input data to a controller. I currently

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.