<form action="" method="post" id="update_trade">
	<input type="hidden" name="trade_id" value="<?php echo $edit->trade_id;?>" />
	<div class="row">
    	<div class="form-group col-md-6">
            <label>Target</label>
            <input type="text" class="form-control" name="target" value="<?php echo $edit->target;?>" >
        </div>
        <div class="form-group col-md-6">
            <label>Stop Loss</label>
            <input type="text" class="form-control" name="stoploss" value="<?php echo $edit->stoploss;?>" >
        </div>
    </div>
    <button type="submit" class="btn btn-warning">Update Trade</button>
</form>
<script>
$("#update_trade").submit(function(){
	var formdata=$(this).serialize();
	$.ajax({
		 type: "POST",
		 url: '<?php echo base_url();?>fnadmin/ajax_update_trade',
		 data: {formdata:formdata},
		 success: function(res){
			 alert(res);
			 //$(".exit_trades").html(res);
		 }
	 }); 
});
</script>