java script çalışmıyor

3 Cevap php

i şifrenizi karşılaştırma ve java script.my yoluyla parolayı onaylamak am kod-

function validate_form(thisform)
{  
with (thisform)
  {  
    if (validate_required(password,"<b>Error: </b>Password must be filled out!")==false)  
  {password.focus();return false;}

  else if (validate_required(cnfpassword,"<b>Error: </b>Confirm Password must be filled out!")==false)
  {cnfpassword.focus();return false;}

  else if (document.getElementById('password').value != document.getElementById('cnfpassword').value)
  {password.focus();Sexy.error("<b>Error: </b>Passwords entered are not same!"); 
  password.value="";cnfpassword.value="";return false;}
  }

validate_required() fonksiyonu uyarı msj gösteriyor ama password compare çalışmıyor, iyi çalışıyor. Ama aynı kod diğer bazı SAYFA.I iyi çalışıyor sayfa önbelleğe-önlemek için bazı php kodu yazdım

<?php
session_start();
session_cache_limiter('nocache');
header('Pragma: no-cache');
?>

what's the problem???

3 Cevap

Garip kodu!

Ne yapar

with (thisform)

do ? Does it allow to have password and cnfpassword in the current scope ?

Eğer öyleyse, neden yapmıyorsun:

else if (password.value != cnfpassword.value)

?

Bunun dışında, ben PHP AYRICA formu doğrulamak için öneririz.

Muhtemelen değerleri kendileri ile bir ilgisi yoktur; Eğer adım ve hata oluyor nerede görmek yardımcı olmak için bir javascript debugger var mı? Eğer Firefox kullanıyorsanız, ben addon tavsiye Firebug.

make sure the form input id's are correct (password and cnfpassword). also if they are, you could try changing

if (document.getElementById('password').value != document.getElementById('cnfpassword').value)

karşı

if (password.value != cnfpassword.value)