Results 1 to 2 of 2

Thread: Using OnFocusOut

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    70

    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.

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    <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
  •  



Click Here to Expand Forum to Full Width