Witam,
Mam dwa kody.
Pierwszy w sekcji <head>
<script type="text/javascript"> function ajax_check_input(input_name, input_value) {
advAJAX.get({
url : "ajax-register.php?input_name="+input_name+"&input_value="+input_value,
onLoading : function(obj) { document.getElementById(input_name).innerHTML = 'Sprawdzam pole...'; },
onSuccess : function(obj) { document.getElementById(input_name).innerHTML = obj.responseText; }
});
}
function check_passwd(input_value) {
passwd1 = document.getElementById('a_pass11').value;
passwd2 = input_value
if (passwd1 != '') {
if(passwd2 == passwd1) {
document.getElementById('a_pass2').innerHTML = 'Pole wypełnione poprawnie.';
}
else {
document.getElementById('a_pass2').innerHTML = '
<span style="color:red;">Podane has
ła nie zgadzaj
ą si
ę.
</span>';
}
}
}
Drugi w dokumencie:
<form method="post" action="rejestracja.html" enctype="multipart/form-data"> <input class="formreg" type="text" name="a_username" onblur="ajax_check_input(this.name, this.value);" value="" />
<div id="a_username" class="komunikat"></div> <input class="formreg" type="password" name="a_pass1" id="a_pass11" value="" onblur="ajax_check_input(this.name, this.value);" /> <div id="a_pass1" class="komunikat"></div> <input class="formreg" type="password" name="a_pass2" onblur="check_passwd(this.value);" value="" /> <div id="a_pass2" class="komunikat"></div>
<input class="formreg" type="text" name="a_email" value="" onblur="ajax_check_input(this.name, this.value);" /> <div id="a_email" class="komunikat"></div> <textarea name="a_bio" class="formregb" onblur="ajax_check_input(this.name, this.value);"></textarea> <div id="a_bio" class="komunikat"></div>
<input class="formreg" type="text" name="a_location" value="" onblur="ajax_check_input(this.name, this.value);" /> <div id="a_location" class="komunikat"></div> <div class="a"><input class="formreg" type="text" name="a_website" value="" onblur="ajax_check_input(this.name, this.value);" /></div> <div class="a"><input class="formregc" type="file" name="a_img_file"></div> <div class="a"><input type="checkbox" name="a_newsletter" value="ON"></div> <div class="a"><input type="checkbox" name="a_regulation" value="ON"></div>
<div class="signup2" style="float:left;margin:0 0 6px 30%;"> <input class="signup" type="submit" value="zarejestruj" />
Mozilla ok, Opera i IE coś chrzanią.
Widzicie gdzieś jakiś problem?
Pozdrawiam,
Michał.
Ten post edytował mokry 10.03.2008, 09:15:11