You can't convert a javascript variable into a php variable without communication with the server. So if you would like to turn a client side variable (your input value) into a php variable BEFORE submitting a form you'll need to post/get this variable to the server in a separate request. The best way to do this is by an asynchronous ajax call. If you are using jquery this can be very simple:
$.ajax({
url: '/path/to/file.php',
type: 'POST',
dataType: 'text',
data: {param1: $("input[type='text'][name='s_amount']").val()},
})
.done(function(response) {
console.log("response");
//do something with the response
})
.fail(function() {
console.log("error");
})
.always(function() {
console.log("complete");
});
On the server you can receive this value by getting the posted data like so
$myphpvariable= $_POST['param1'];
//here you can manipulate/validate your variable and echo something back to the client
echo 'this is my php variable: '.$myphpvariable;
Now your ajax call will receive "this is my php variable: [x]" in its .done() callback.
EDIT: don't forget you have a javascript console in your browser (for example firebug). this can be very handy to see what's going on.