how can i trigger onChange() when maxlength reached without . . .

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • noViagraHere

    how can i trigger onChange() when maxlength reached without . . .

    I have a simple text input box in a form

    <input type="text" name="SRCCODE" size="8" maxlength="6"
    onChange="reLoa d(this)" value="value">

    what i am wanting to do is when someone enters text into this box because it
    may be the only info changed on the form, how can i trigger the onchange
    function when the user types in the 6th digit of text without having to wait
    for the text box to be blurred or tabbed out of?


  • Philip Ronan

    #2
    Re: how can i trigger onChange() when maxlength reached without .. .

    On 03.8.2 11:39 PM, noViagraHere wrote:
    [color=blue]
    > I have a simple text input box in a form
    >
    > <input type="text" name="SRCCODE" size="8" maxlength="6"
    > onChange="reLoa d(this)" value="value">
    >
    > what i am wanting to do is when someone enters text into this box because it
    > may be the only info changed on the form, how can i trigger the onchange
    > function when the user types in the 6th digit of text without having to wait
    > for the text box to be blurred or tabbed out of?[/color]

    You must be in a hurry! What happens if you make a typing mistake?

    I don't know if this will work, but try it anyway

    onkeypress="if (this.value.len gth==6) reLoad(this)"

    Phil

    --
    Philip Ronan
    phil.ronanzzz@v irgin.net
    (Please remove the "z"s if replying by email)


    Comment

    Working...