在php中关闭按钮单击事件动态地为文本框分配值[关闭]

This is my Html Code :

<input type="text" id="state" name="state"  autocomplete="off">
<input type="text" id="district" name="district" autocomplete="off">
<input name="Submit" type="submit" value="Submit">

and this is my php code in server side :

if(isset($_POST['Submit'])){        
    $state = $_POST['state'];
    //what we have to write here to assign this value to 2nd textbox.   
}   

Please help me to solve this.....

Well if you're involving PHP, then it's not going to be as smooth as JavaScript (you'll see the screen refresh).

In this case as well you will need to have the form and the PHP on the same page:

<?php

$district = "";
$state    = "";

if(isset($_POST['Submit'])){        
    $state = $_POST['state'];
    $district = $state;
}

?>

<form method="post" action="">

<input type="text" id="state" name="state" value="<?php echo $state; ?>" autocomplete="off">
<input type="text" id="district" name="district" value="<?php echo $district; ?>" autocomplete="off">
<input name="Submit" type="submit" value="Submit">

</form>

So once you type something into the first text field, and submit, you'll see that it appears in the second text field.