• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use replace function in jsp

 
Wu Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I�m trying to remove a character �$� from my jsp form before its submitted to the database since the database doesn�t accept �$�. I�ve been reading about the replace function but I�m unsure how to implement it. Does anyone know how to implement the replace function in JSP? Here is a snippet of my code:
javascript:%20x()
<tr>
<td valign="top" align="left"><b>Estimated Total Partner Funds::</b>
<br><html:text property="estTotalFunds" styleClass="required" />
</td>
</tr>
javascript:%20x()

The property=estTotalFunds is the variable that contains the values. Essentially, the value comes in $22.00 and I need it to be 22.00 before I submit it to the database.

Any assistance would be greatly appreciated.
Thank you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to change the data before it is written to the database, that should be handled in the code that writes to the database -- not at the UI level.
[ October 31, 2008: Message edited by: Bear Bibeault ]
 
Wu Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The '$' character is being appended to the value in a database script the '$' character is only for display purposes and I need to remove it before I submit the data to the database.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then remove it in the code just before it's written to the DB.
 
Wu Tang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your replies. I understand what needs to be done the question is how to go about doing it.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the methods on the String class?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic