Wie kann ich überprüfen ob mind. ein name ausgefüllt ist??
wie gibt man das array n[] an in diesem javascript?
function validate_form()
{
if (document.formCreate.title.value=="")
{
alert ("Please enter a name");
document.formular.<????????>.focus();
return false;
}
[das ist mein formular:
<div align="center"><form name= "formCreate" action="resorttest.php" method="GET"
onSubmit="return validate_form()" enctype="text/plain">
<p> Please enter the names which you want to create your ranking and press "OK"<br>
This is only a test version now, later you can save your personal ranking. </p>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="50%" align="center"><div align="right">
<p>name 1:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="50%" align="center"><div align="right">
<p>name 2:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="50%" align="center"><div align="right">
<p>name 3:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
wie gibt man das array n[] an in diesem javascript?
function validate_form()
{
if (document.formCreate.title.value=="")
{
alert ("Please enter a name");
document.formular.<????????>.focus();
return false;
}
[das ist mein formular:
<div align="center"><form name= "formCreate" action="resorttest.php" method="GET"
onSubmit="return validate_form()" enctype="text/plain">
<p> Please enter the names which you want to create your ranking and press "OK"<br>
This is only a test version now, later you can save your personal ranking. </p>
<table border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="50%" align="center"><div align="right">
<p>name 1:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="50%" align="center"><div align="right">
<p>name 2:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
<td width="50%" align="center"><div align="right">
<p>name 3:
</td>
<td width="50%" align="center"><div align="left">
<p><input type="text" name="n[]" size="20" maxlength="20">
</td>
</tr>
<tr>
Kommentar