Question: I want to fetch json data from json object.
My json data is:`{"avg":2.5}` and my android code is 

```
public class AsyncTaskParseJson extends AsyncTask < String, String, String > {

        final String TAG = "AsyncTaskParseJson.java";

        // set your json string url here
        String yourJsonStringUrl = "http://www.bsservicess.com/photoUpload/star_avg.php?bookName=" + book_name;

        // contacts JSONArray

        @Override
        protected void onPreExecute() {}

        @Override
        protected String doInBackground(String...arg0) {

            try {
                JSONParser jParser = new JSONParser();

                // get json string from url
                JSONObject json = jParser.getJSONFromUrl(yourJsonStringUrl);

                // get the array of users
                JSONObject dataJsonArr = json.getJSONObject(str);

                String c = dataJsonArr.getString("avg");
                na = c;
                starts = Float.parseFloat(c);

            } catch (JSONException e) {
                e.printStackTrace();
            }

            return null;
        }

        @Override
        protected void onPostExecute(String strFromDoInBg) {
            super.onPostExecute(strFromDoInBg);

            netRate.setRating(starts);
            Toast.makeText(mybookview.this, Float.toString(starts), Toast.LENGTH_SHORT).show();
        }

```

But somehow its not working.I have trie every tutorial and evrything but nothing works.plz help me

Answer: 
```
<form action="action.php" method="post">
   <input name="input1">
   <input name="input2">

   <button name="submit" value="submit1">Submit</button>
   <button name="submit" value="submit2">Submit</button>
</form>

```

PHP

```
<?php
if ($_POST['submit'] == 'submit1') {
   // code with input1
} else if ($_POST['submit'] == 'submit2') {
   // code with input2
}

```

if you submit form by pressing enter, submit1 will be default value
Give different name for your button, for example `"button1"` and `"button2"`, and when you click that button with the name `"button1"` , you can save the hidden field value, if you click `"button2"` just ignore the hidden field.