input fields

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

    input fields

    Hello,
    I want to test some input fields if the user has entered something.
    That I do with a Javascript function. But I only know the form <form
    action="ausg.ph p" method="post"> and so my function doesn't work
    yet(it is initiated with onclick). What is a solution when I want to
    retain my JAvaScript function because I think it is lesser
    encumbrance.
    Where can I inform me about that.

    Many thanks
  • Justin Koivisto

    #2
    Re: input fields

    BjoernJackschin a wrote:
    [color=blue]
    > Hello,
    > I want to test some input fields if the user has entered something.
    > That I do with a Javascript function. But I only know the form <form
    > action="ausg.ph p" method="post"> and so my function doesn't work
    > yet(it is initiated with onclick). What is a solution when I want to
    > retain my JAvaScript function because I think it is lesser
    > encumbrance.
    > Where can I inform me about that.
    >
    > Many thanks[/color]

    <html>
    <head>
    <script type="text/javascript">
    function myJavascriptFun ction(myform){
    if(myform.input _field.value == ""){
    alert("no input defined");
    myform.input_fi eld.focus();
    return false;
    }
    }
    </script>
    <body>
    <form method="post" action="ausg.ph p" onSubmit="retur n
    myJavascriptFun ction(this);">
    <input type="text" name="input_fie ld">
    <input type="submit">
    </form>
    </body>
    </html>

    --
    Justin Koivisto - spam@koivi.com
    PHP POSTERS: Please use comp.lang.php for PHP related questions,
    alt.php* groups are not recommended.
    Official Google SERPs SEO Competition: http://www.koivi.com/serps.php

    Comment

    Working...