• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to use replace function in jsp

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked the methods on the String class?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic