| Author |
How to use replace function in jsp
|
Wu Tang
Greenhorn
Joined: Oct 31, 2008
Posts: 4
|
|
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
Joined: Jan 10, 2002
Posts: 56180
|
|
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 ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Wu Tang
Greenhorn
Joined: Oct 31, 2008
Posts: 4
|
|
|
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
Joined: Jan 10, 2002
Posts: 56180
|
|
|
Then remove it in the code just before it's written to the DB.
|
 |
Wu Tang
Greenhorn
Joined: Oct 31, 2008
Posts: 4
|
|
|
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
Joined: Jan 10, 2002
Posts: 56180
|
|
|
Have you checked the methods on the String class?
|
 |
 |
|
|
subject: How to use replace function in jsp
|
|
|