Message from JavaScript discussions

May 2019

— Dear all, could anybody please help?

— 

I have an input box and I assigned the value (Or maybe that is a string) of 1,286.09. I made sure that such number/or string shows up in the input box, then I used Ajax to send that to a php file named price.php. But it seems like I can only capture the first number of 1.

— <form action="" method="post">
<input id="myprice" type="text" name="sellprice" value="1,286.09" /><br>

Message permanent page

— Sorry, please see code below

— <form action="" method="post">
<input id="myprice" type="text" name="myprice" value="1,286.09" /><br>

Message permanent page

— Var myprice = $("#myprice").val();
$.ajax({
type:'POST',
data:myprice,
url:'/price.php'
.......

— The php file has the following code: $amount = $_POST['myprice'];

— Any advise would be appreciated, thank you so much.

— 😢

— Is there anyway i can prevent mutability of an Array in JS?

— Object.freeze

— In the network tab of your developer tools, is the data sent correctly?