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 6020951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:38:32+00:00 2026-05-23T03:38:32+00:00

I am trying to submit a form via JQuery Mobile. I have: <form action=#pagetwo

  • 0

I am trying to submit a form via JQuery Mobile.

I have:

<form action="#pagetwo" method="post" name="myform">
<input type="text" name="myname">
<input type="submit" value="submit" />

... then I have....

<div data-role="page" id="pagetwo">
...
<?php echo $_GET["myname"]; ?>

The first problem is that it’s not doing anything when I hit the submit button. It should go to #pagetwo

What I’m I doing wrong please?

UPDATE:

Here is more code as requested:

<div data-role="page" id="home">

    <div data-role="header">
        <h1>Page 1</h1>
    </div><!-- /header -->

    <div data-role="content">
    <form action="#page2" method="post" name="myform">
    <div data-role="fieldcontain">
        <fieldset data-role="controlgroup">
            <legend>Check Property Elements:</legend>
              <input type="checkbox" name="checkbox-1" id="checkbox-1" class="custom" /><label for="checkbox-1">Yes or No</label>
        </fieldset>
    </div>
    </form>


    ...


    <div data-role="page" data-theme="a" id="page2">
<div data-role="header">
        <h1>This is page 2</h1>
    </div><!-- /header -->
    <div data-role="navbar">
        <ul>
            <li><a href="#home">Home</a></li>
        </ul>
    </div><!-- /navbar -->

    <div data-role="content" data-theme="d">

    <?php if (isset($_POST['checkbox-1'])) {
  // do something with $_POST['value']
  echo 'yessss';

  var_dump($_POST);

}  ?>
  • 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-23T03:38:33+00:00Added an answer on May 23, 2026 at 3:38 am

    First, It is possible that is visible when You hit submit and browser do not scrolls You here (because it is visible).

    Try to put some big chunk of something before #pagetwo and see how it goes.

    <!doctype html>
    <html>
      <head>
      </head>
      <body>
        <form action="#foo" method="get" accept-charset="utf-8">
          <p><input type="submit" value="Continue &rarr;"></p>
        </form>
        <div style="height: 3000px; background-color: #000;">
        </div>
        <div id="foo">Foo</div>
      </body>
    </html>
    

    Second, I think You should post you data to different page (or url) not just different anchor.

    Third, I see another problem with Your code. Your form says <form method="post" but afterwards You are outputting from get <?php echo $_GET["myname"]; ?>. It should be <?php echo $_POST["myname"]; ?>

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

Sidebar

Related Questions

I'm trying to submit a simple login form via ajax on a jQuery Mobile
I am trying to fire a form submit via jQuery and have a particular
I'm trying to submit a form when a select changes using jQuery Mobile. I
I am trying to submit a form with method GET and action index.php?id=3. The
I have a form which is given below : <form method=post id=contactForm action=> <fieldset
I am trying to use jquery validator plugin and form submit via ajax in
I have a form I'd like to submit as JSON via jQuery AJAX, so
Can you submit a form via AJAX that has a file type input? I
I'm trying to create a form with a submit button via jQuery using append().
I have a a form: <form id=deletesubmit style=display:inline > <input style=width:50px type=text id=delcustomerid name=delcustomerid

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.