Question: I'm new in Yii Framework. I want to check user exists or not with ajax.

**view file**

```
<form method="post" action="<?php echo $baseUrl;?>/persons/login" role="form"><br>
    <div style="display: block;margin-left:14%">
        <div>İstifadəçi adı</div>
        <div>
            <input type="text" name="istiad" autocomplete="off" role="textbox" tabindex="1">
        </div>
        <div>Parol</div>
        <div>
            <input type="password" name="parol" autocomplete="off" role="textbox" maxlength="20" tabindex="2"><br>
        </div>
        <?=CHtml::button('daxil ol', ['submit'=>['persons/login', 'i'=>1]]); ?>
    </div>
</form>

```

### EDIT

[error must looks like this](http://i.stack.imgur.com/KUIW1.png)

how can i do this ?
 thanks!

Answer: 
You can use something like this:

```
final Button mClose = (Button) findViewById(R.id.force_close);
mClose.setOnClickListener(new View.OnClickListener() {
    public void onClick(View v) {           
        System.exit(0);
        //or you can use 
        //android.os.Process.killProcess( android.os.Process.myPid());
    }
});

```
Try this -

```
android.os.Process.killProcess(android.os.Process.myPid());

```

It will **destroy** the app.

Alternatively, you can do this -

```
Intent homeIntent = new Intent(Intent.ACTION_MAIN);
homeIntent.addCategory( Intent.CATEGORY_HOME );
homeIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(homeIntent);

```

This will take you to the home screen and the current processes will be **paused**.