|
-
Feb 3rd, 2004, 10:16 AM
#1
Thread Starter
Lively Member
Using OnFocusOut
I am trying to trap the text of an textbox in a form on one of my web pages.
I have a textbox that allows the user to enter a dollar amount. Some users will enter just numbers, and some users will enter the dollar sign and then the numbers.
I want to use OnFocusOut to see if the user has entered a dollar sign and strip it out if he or she has.
Can anyone give me some help with this? I'd appreciate it.
Here is what I am using right now. I want to embed the onfocusout either inside the <input ...> tags or in a <script ...> set of tags:
Code:
<tr>
<td align="right"><font class="form_label">Annual Revenue (USD):</font></td>
<td><input name="revenue"></font></td>
</tr>
Thanks.
-
Feb 3rd, 2004, 11:07 AM
#2
Frenzied Member
<input type="text" onBlur="this.value=parseInt(this.value)">
This will get rid of any text and just leave the numbers
Have I helped you? Please Rate my posts. 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|