BjoernJackschina wrote:
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.php" 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
<html>
<head>
<script type="text/javascript">
function myJavascriptFunction(myform){
if(myform.input_field.value == ""){
alert("no input defined");
myform.input_field.focus();
return false;
}
}
</script>
<body>
<form method="post" action="ausg.php" onSubmit="return
myJavascriptFunction(this);">
<input type="text" name="input_field">
<input type="submit">
</form>
</body>
</html>
--
Justin Koivisto -
sp**@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