Здравейте! Направих си извеждане без рефреш с jQuery и AJAX. Някой може ли да ми каже как да направя, така че според всяко поле да му извежда стойността. Тоест срещу потребител - свободно/заето, парола - къса/дтлга и т.н.. Ето кода:
Код:
<html>
<head>
<script src="jquery-1.3.2.js" type="text/javascript"></script>
<script>
var user = $("#user").val();
var pass = $("#pass").val();
var pass2 = $("#pass2").val();
var email = $("#email").val();
var question = $("#question").val();
function check() {
$.ajax({
type: "POST",
url: "check.php",
data: "user=" + user + "&&pass=" + pass + "&&email=" + email + "&&question=" + question,
success: function(result) {
$("#result").hide().html(result).fadeIn(1000);
}
});
}
</script>
</head>
<body>
<form method="post" action="Pages/reg.php">
<table align="center" style="margin: 0 auto; top: 0; bottom: 0; right: 0; left: 0;" width="320px" border="0">
<tr align="center">
<b style="color: #FFF;"><center>Ако нямате регистрация можете<br/> да си направите безплатна от тук:</center></b><br/>
<td style="color: #FFF;">Потребителско име<strong style="color: #00FF00;">*</strong></td>
<td><input onchange="check()" id="user" name="potrebitel" type="text" maxlength="20" style="opacity:0.8;filter:alpha(opacity=80)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80" /></td>
<td width="150px"><div id="result"></div></td>
</tr>
<tr>
<td style="color: #FFF;">Парола<strong style="color: #00FF00;">*</strong></td>
<td><input onchange="check()" id="pass" name="pass" type="password" maxlength="15" style="opacity:0.8;filter:alpha(opacity=80)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80" ></td>
<td width="150px"><div id="result"></div></td>
</tr>
<tr>
<td style="color: #FFF;">Повторете паролата<strong style="color: #00FF00;">*</strong></td>
<td><input onchange="check()" id="pass2" name="pass2" type="password" maxlength="15"style="opacity:0.8;filter:alpha(opacity=80)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80" ></td>
<td width="150px"><div id="result"></div></td>
</tr>
<tr>
<td style="color: #FFF;">E - Mail<strong style="color: #00FF00;">*</strong></td>
<td><input id="email" name="email" type="text" maxlength="20" style="opacity:0.8;filter:alpha(opacity=80)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100"onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80" ></td>
<td width="150px"><div id="result"></div></td>
</tr>
<tr>
<td> </td>
<td valign="top"><input type="submit" name="Submit" id="login" value="Регистрация" style="opacity:0.8;filter:alpha(opacity=80)" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.8;this.filters.alpha.opacity=80"/></td>
</tr>
</table>
</form>
</body>
</html>