Jump to content

Another question - regarding form variables


dannybrazil

Recommended Posts

Hello guys

few min' ago some kind people helped me with a piece of code :

$string = R$100.000,00 ;
$result = preg_replace('/[^0-9]+/', '', $string);
echo $result;

 

what i wanted to know now is :

 

Is it possible to do this "change" before the form is being uploaded to the data base

 

i mean already to make it replace the "value" in the input ?

 

this is my input:

<td>
<strong>Preco</strong>:<br />
      <input type="text" name="preco" width="20px" onBlur="this.value=formatCurrency(this.value);"> 

</td>

 

and it will update the database with $R100.00,0 , is it possible to make the update already just numbers?

 

Danny

If its after submitting the form how would it update the entry ?

 

i want that the user will see the price as a price format BUT the info/data that will be uploaded to the database AFTER submission with be as a regulat INT type(just numbers)

 

Danny

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.