Problem with validation of field

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

    #1

    Problem with validation of field

    Hi,
    I have a field that requires validation when you press a button as
    follows:
    <form name="form_affi che" enctype = "multipart/form-data"
    method="get">
    .....
    <td width="80"><inp ut type="Button" name="submitBut ton"
    value="Modifier " tabindex="3" onClick="if(isV alid())
    {document.form_ affiche.action= 'order.php';doc ument.form_affi che.submit();}r eturn
    false;"></td>
    .....
    </form>
    The validation works perfectly when the button is pressed. However,
    should the user enter an invalid number and press ENTER as opposed to
    the button "Modifier", then the invalid number is taken into
    consideration.

    Thank you in advance for any suggestion or solution.
    Kind regards
    Bilal
  • Brynn

    #2
    Re: Problem with validation of field


    maybe change your javascript to the form's onSubmit
    versus button's onclick .. and make the input type submit for the
    button ... this way pressing enter or the button would activate the
    submit procedure?

    Brynn




    On 23 Jan 2004 21:34:52 -0800, bjeewa@hotmail. com (Bilal) wrote:
    [color=blue]
    >Hi,
    >I have a field that requires validation when you press a button as
    >follows:
    ><form name="form_affi che" enctype = "multipart/form-data"
    >method="get" >
    >....
    ><td width="80"><inp ut type="Button" name="submitBut ton"
    >value="Modifie r" tabindex="3" onClick="if(isV alid())
    >{document.form _affiche.action ='order.php';do cument.form_aff iche.submit();} return
    >false;"></td>
    >....
    ></form>
    >The validation works perfectly when the button is pressed. However,
    >should the user enter an invalid number and press ENTER as opposed to
    >the button "Modifier", then the invalid number is taken into
    >consideratio n.
    >
    >Thank you in advance for any suggestion or solution.
    >Kind regards
    >Bilal[/color]

    Brynn


    I participate in the group to help give examples of code.
    I do not guarantee the effects of any code posted.
    Test all code before use!

    Comment

    Working...