Точно, тогда так можно:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#indexform").submit(
function () {
var fields = {
"#username": ["#emptyname", "Введите логин"],
"#password": ["#emptypass", "Введите пароль"],
"#secretcode": ["#emptycode", "Введите символы с картинки"]
},
error = false;
for (i in fields) {
if ($(i).val() == "") {
$(fields[i][0]).val(fields[i][1]);
error = true;
} else {
$(fields[i][0]).val('');
}
}
if (error) return false;
});
})
</script>
<form action="#" method="post" id="indexform">
<table border="0">
<tr>
<td colspan="2">Введите Ваше имя:</td>
<td>
<input type="text" size="15" maxlength="20" name="username" id="username"/>
</td>
<td>
<input type="text" class="text" disabled="disabled" name="emptyname" id="emptyname" />
</td>
</tr>
<tr>
<td colspan="2">Введите пароль:</td>
<td>
<input type="password" size="15" maxlength="16" name="password" id="password" />
</td>
<td>
<input type="text" class="text" disabled="disabled" name="emptypass" id="emptypass"/>
</td>
</tr>
<tr>
<td>Введите код: </td>
<td>
<img src="captcha.php" alt="защитный код" id="imgCaptcha" />
<input type="image" src="img/refresh.jpg" onclick="return refreshCaptcha();" />
</td>
<td>
<input type="text" size="15" maxlength="10" name="securecode" id="secretcode" />
</td>
<td>
<input type="text" class="text" disabled="disabled" name="emptycode" id="emptycode"/>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" value="Регистрация" class='button' onclick="<?php echo $reglink;?>" />
</td>
<td>
<input type="submit" value="Вход" class='button' id="authsubmit" />
</td>
</tr>
</table>
</form>