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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:59:22+00:00 2026-05-26T14:59:22+00:00

Here’s my problem: I have a form in index.html, it will have a text

  • 0

Here’s my problem:
I have a form in index.html, it will have a text input, and the value will be $.post to a php page that should process it and will return a value. My code:

index.html:

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>

<script>
    function get(){
        $.post('http://xxx/xxx/get.php', {name: form.name.value},
            function(output){
                $('#result').html(output).show();
            });
    }
</script>

</head>
<body>

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

<div data-role="header">
<h1>Header</h1>
</div>

<div data-role="content">

<form name="form" id="form">
    <input type="text" name="name"><input type="button" value="Get Output" onClick="get();">
</form>

<p> result here: </p>
<div id="result"></div>

</div>

<div data-role="footer">
<h4>Footer</h4>
</div>

</div>
</body>
</body>
</html>

and get.php

<?php
$name = $_POST['name'];
echo $name;
?>

This is simple coding for my testing purpose. As we can see from the code, whatever text we input in the textfield will be processed in get.php. Since I put echo $name there, the name SHOULD be shown in div id = result in index.html. I think I got the code right but it just didn’t work. So I need help from the experts here… what did I do wrong?

  • 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-26T14:59:23+00:00Added an answer on May 26, 2026 at 2:59 pm

    A few points:

    1.
    Add the remote server to the whitelist…if you are using blackberry ou must edit the config.xml file, if is a ios app, you must change the plist file of the project.

    EDIT 2011-11-03: In Android:
    Make sure this line is in phonegap app manifest file:
    < uses-permission android:name=”android.permission.INTERNET”>

    2.
    Try adding this header to the php file header(‘Access-Control-Allow-Origin: *’);

    EDIT 2011-11-03: this header must be included on the beginning of the PHP file.

    1. $(‘#result’).html(output).show(); the show method is not necesary, you must use that only if the field has the hidden attribute.

    Good Luck!

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

Sidebar

Related Questions

Here is my problem...I have a page that loads a list of clients and
Here's a problem I ran into recently. I have attributes strings of the form
Here is my problem : I have a post controller with the action create.
Here is my code (Say we have a single button on the page that
Here is the issue I am having: I have a large query that needs
Here's my scenario - I have an SSIS job that depends on another prior
Here's a coding problem for those that like this kind of thing. Let's see
Here is the scenario: I'm writing an app that will watch for any changes
Here's my problem I have this javascript if (exchRate != ) { function roundthecon()
Here is what I want to do. Use this HTML line and have the

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.