aspose file tools*
The moose likes JSP and the fly likes how to format when i enter number on textbox see code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to format when i enter number on textbox see code" Watch "how to format when i enter number on textbox see code" New topic
Author

how to format when i enter number on textbox see code

chrstian ferma
Ranch Hand

Joined: Mar 26, 2014
Posts: 56

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<fmt:formatNumber type="currency" value="12345.6789"/></p>
<input type = "text"/>

this one is working if i set value in fmt but what i want to happen is when i enter a number in textbox it will be fommated on the format that i want thanks so i think i need to an of og text and set it into value of fmt? my plan is when i enter a number in textbox it will automatically formated thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

chrstian ferma wrote: my plan is when i enter a number in textbox it will automatically formated

Not with JSP. JSP executes on the server long before the page is sent to the browser. You'll need to use JavaScript.

Please read this article to understand how JSP works.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
chrstian ferma
Ranch Hand

Joined: Mar 26, 2014
Posts: 56

thank you, so i will make a function that will get every number that i enter and autoumatically format it and set it to UI? my plan is the number is formatted already when i input it on textbox before i click the button thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to format when i enter number on textbox see code