jeudi 24 août 2017

How to pass PHP input text to JavaScript and back to PHP label

I have a PHP textBox that allows user to input an amount

<input id="inputAmount" type="number" class="form-control" name="amount" required>

and a label to display a message.

<label id="Message" style="display:none">
   'ExchangeRate is ' . $Rate . 'and converted amount is '. $ConvertedAmount
</label>

and this is my concept of a JavaScript for calculation

<script>
    $("#inputAmount").change(function(){
        var ConvertedAmount = Rate * inputAmount;
        return ConvertedAmount;
    });
</script>

How should I do for making it work to show an instant converted result to the user?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xhycx0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire