This is my php & html code for show numbers in words. this works correctly <input type="text" value="<?php include("number_words.php"); echo convert_number_to_words(123); ?>" size="70" readonly="readonly" /> this is my final total amount html code <input type="text" name="totalamount" id="totalamount" size="8" readonly="readonly" />.

here i am doing convert numbers into words. but i want to do if user onkeyup on totalamount input field then only it will show the words. echo convert_number_to_words(how to pass the value from totalamount to here);

You can do it all in Javascript if you do not need server processing. In this case just write a function to convert number to words and fire it on keyup event.

Now, if you need to process numbers on a server (as it seems from your post) then you will have to use ajax to fire requests on keyup.

In both cases jquery might help you so you do not have to write too much code and it will work in most browsers correctly. For ajax solution take a look at jquery post function.