服务器端表单不起作用

I have form in server side, witch downloads every page refresh, also this form has a submit button. Writing code below all html to catch submit handler, I got fault.. How should I do it? Friend told me that i had to execute script with submit catch only when my form is loaded.. P.S. Form also loads with js after button "edit" push.

$test variable holds html code with buttons, divs etc. I passing it as json. So for every row it creates a button. http://postimg.org/image/p1ugsfw4f/. at same file

if(isset($_REQUEST['update'])){
$vardas = $_POST['vardas'];
$id = $_POST['id']; 

$sqel = mysql_query("UPDATE `client_objects` Set ob_name = '$vardas' WHERE ob_id = $id");}

I have post request.. in form after button "save Changes" pushed, i got redirected to php file. Isset works perfectly. All i want to not open php file. Better solution alarm.

$("#update").submit(function() {
    $.ajax({

        type: 'POST',
        url: 'demo/client_view_search_content.php',
        data: $("#formaclient").serialize(),

        success: function () {
            alert('Success!')
        },
        error: function () {
            alert('Failure!')
        }
    });
    return false;});

But this code can't catch the submit handler..

PHP file. ==>

$result = mysql_query("SELECT * FROM `client_objects`");
while($row = mysql_fetch_array($result)){
   $records['data'][]= array( $row['ob_id'],$row['ptc_id'],$row['ob_name'],$row['ob_name'],$row['ob_name'],$row['ob_name'],$row['ob_name'],$row['ob_name'], $row['ob_name'], $test = "<div class='portlet-body'>

                                <a class='btn default' data-toggle='modal' href='#$i'>
                                Edit </a>


                        <div id='$i' class='modal fade' tabindex='-1' aria-hidden='true'>

                            <div class='modal-dialog'>
                                <div class='modal-content'>
                                    <div class='modal-header'>
                                        <button type='button' class='close' data-dismiss='modal' aria-hidden='true'></button>
                                        <h4 class='modal-title'>Responsive & Scrollable</h4>
                                    </div>
                                    <form method='post' id = 'formaclient' action = 'demo/client_view_search_content.php' >
                                    <div class='modal-body'>
                                        <div class='scroller' style='height:300px' data-always-visible='1' data-rail-visible1='1'>
                                            <div class='row'>
                                                <div class='col-md-6'>
                                                    <h4>Some Input</h4>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control' name = 'vardas' value = '$row[ob_name]'>

                                                    </p> 
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control' name = 'id' value = '$row[ob_id]'> 
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                </div>
                                                <div class='col-md-6'>
                                                    <h4>Some More Input</h4>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                    <p>
                                                        <input type='text' class='col-md-12 form-control'>
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class='modal-footer'>
                                        <button type='button' data-dismiss='modal' class='btn default'>Close</button>
                                        <button type='submit' class='btn blue' name = 'update' id = 'update' >Save changes</button>
                                    </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                                              "); $i++; 

}if(isset($_REQUEST['update'])){
$vardas = $_POST['vardas'];
$id = $_POST['id']; 

$sqel = mysql_query("UPDATE `client_objects` Set ob_name = '$vardas' WHERE ob_id = $id");}

Your question is not a 100% clear, but I think you are trying to check for a user pressing the submit button. If you want to know if the user has pressed the submit button you can do this using the value that the submit button gives you:

 <input type="submit" name="submit" value="Submit">

And then in your PHP Script you can check for it's name in your POST/GET Array:

//$_POST['submit'] will contain the value, so it will be set to "Submit"
if(isset($_POST['submit'])){
   echo 'he pressed submit!';
}